You need to sign in to do that
Don't have an account?
EPSWDEV
Database.update(custom_obj) fails
I have a controller extension for a custom object edit page, and what I am trying to do is update a different custom object as part of the save functionality.
However I get the following error when I execute the code:
Update failed. First exception on row 0 with id a0B80000002JH1yEEF; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, <field1_label> already exists. Please choose another: [<field1_name>]
strings in <> are substituted to origianl values. and there is no validation whatsoever on this custom obj and its fields. Can please somebody explain whats wrong here ?
Thanks
Code:
CustomObj co = [Select Id,field1,field2,field3 from CustomObj where Id =:<id string>]; co.field1 = 'someval'; co.field2 = 'someval2'; Database.update(co);
Update failed. First exception on row 0 with id a0B80000002JH1yEEF; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, <field1_label> already exists. Please choose another: [<field1_name>]
strings in <> are substituted to origianl values. and there is no validation whatsoever on this custom obj and its fields. Can please somebody explain whats wrong here ?
Thanks
BUT, still I am not changing the value of field3 in my code if you notice, so why does it give me an error. I am simply trying to modify the field2 and field1 for a existing customobj record.
Thanks,
Message Edited by EPSWDEV on 01-08-2009 10:53 AM
the rule was vlookup(field3,field3,name) and it seems like this constraint was being fired on update and insert.
Thanks