Replies: 2 comments 5 replies
-
Hi Victor, that certainly should work. I've just tested this: UPDATE account
SET primarycontactid = '3c2580da-7ccc-e911-a813-000d3a7ed5a2'
WHERE accountid = 'ae0bdb02-1bac-eb11-8236-000d3ad5c780'
AND primarycontactid IS NULL; and I got the message
I could then run: SELECT primarycontactid
FROM account
WHERE accountid = 'ae0bdb02-1bac-eb11-8236-000d3ad5c780' and see the expected new primarycontactid value. When you get the message saying "Updated", does it show the expected number of records that have been updated? Some lookup columns also require some more information to indicate the type of record you're linking to. For example Customer columns that can be account or contact records, or Owner columns that could be systemuser or team records. To update those columns you also need to set the corresponding ___type column, e.g. UPDATE contact
SET ownerid = 'b7e68613-74b8-4c05-9ff4-8c3c418feb1a',
owneridtype = 'systemuser'
WHERE contactid = '3c2580da-7ccc-e911-a813-000d3a7ed5a2' |
Beta Was this translation helpful? Give feedback.
-
Thank you Mark for following up. It's a plain setup with few custom entities with relationships. Where can I send a link with the solution? |
Beta Was this translation helpful? Give feedback.
-
Is it possible to update a lookup column?
Tried this:
UPDATE Tablename
set lookupColumn = 'GUID value from Lookup table'
Says "Updated" but it is not saved.
Sorry, I'm very new to SQL4Cds...
Victor
Beta Was this translation helpful? Give feedback.
All reactions