+ Start a Discussion
Ron WildRon Wild 

Inconsistent results on update contact (person-account) in IDE

I'm running the following test code in the Execute Anonymous window of the IDE and am getting inconsistent results.

 

 

Contact contact = new Contact(id='0034000000RGSfrAAH');
contact.mailingstreet = '123 Oak';
update contact;

 

This contact happens to be a person account.

 

Initially, I get a successful execution (multiple times). But if I wait about 20 seconds and run it, I get:

 

System.DmlException: Update failed.  First exception on row 0 with id 0034000000RGSfrAAH: first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id.

 

Anyone have an idea on why I'm only getting the error part of the time?

 

Thanks,

Ron

 

 

 

kladizkovkladizkov
 This is happening to me too. If I change the data in field, the error goes away, but only to reappear during the second run.