Timeline for Vague error message - duplicates value on record with id
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 25, 2017 at 13:17 | vote | accept | Nick | ||
Mar 25, 2017 at 3:25 | answer | added | Derek F | timeline score: 2 | |
Mar 25, 2017 at 3:15 | comment | added | Nick |
Derek, Thank you so much... that's exactly I was looking for DescribeFieldResult.isUnique() it fixed my problem, please post this as answer.
|
|
Mar 25, 2017 at 2:54 | comment | added | Derek F |
The blog post you linked mentions that this is probably due to having fields marked as unique on your SObject. Does your custom object have any unique fields? If so, I think the easiest way around this error is to simply not include any unique fields in the query string that buildSOQL() is creating (and if you're building the string using the fields from the SObjectDescribeResult , you can use DescribeFieldResult.isUnique() to check if it is unique or not). If you don't query the field, it'd impossible for clone() to duplicate that value.
|
|
Mar 25, 2017 at 2:37 | history | asked | Nick | CC BY-SA 3.0 |