Hi,
I have a database with many foreign key and primary key pairs all based on UNIQUEIDENTIFIER data types. When I go to create a new record I receive the following error:
"Conversion failed when converting from a character string to uniqueidentifier"
Is there something I have wrong?
Hi
I don’t think uniqueid is supported.
what is the data type of FormResponseHeaderID in the db?
Regards
Hi Anthony,
Identifier corresponds to an integer so it will fail.
What you probably want to do is to use the TextToTextIdentifier() whose output will be an identifier of the type text therefore the cast will work. You will also need to guarantee that the fields FormResponseHeaderId and FormsId are identifiers of the type Text, otherwise you will be trying to fit a text inside an integer attribute in the database.
Cheers,
João
Hello Anthony
If you see the data type mapping with Sql server and OutSystems
https://success.outsystems.com/Documentation/10/Reference/OutSystems_Language/Extensibility_and_Integration/Mapping_External_DB_Data_Types_to_OutSystems_Data_Types
uniqueidentifier is mapped as Text, so I believe there is no need to do any conversion, just pass the GUID text as is.
Also the FormResponseHeaderID and FormsID should be of type Text. Can you confirm ?