When I update my custom Record__c a trigger runs, and it calls recalculateFormulas() on the record. This results in the following error:

System.UnexpectedException: Unable to create/update fields: IsDeleted. Please check the security settings of this field and verify that it is read/write for your profile or permission set.

Same thing happens when I update Record__c inside a unit test. The object has several cross-object and non-cross-object formula fields.

Any ideas what's causing this error?

  • 3
    Sounds like a possible bug....If it is I can't believe it made it out as that type should have been caught...(never would have worked) – Eric Nov 17 '15 at 0:16
  • 1
    @Eric I'm seeing similar issues after using recalculateFormulas() for the first time today : Opportunity: bad field names on insert/update call: Account, Owner - the irony is that if I hadn't read this OP a few days ago, I wouldn't have known this new method has been added :-( – cropredy Nov 24 '15 at 1:02
  • 2
    For reference, see also: salesforce.stackexchange.com/q/100627/2602 – cropredy Nov 25 '15 at 19:44
  • Any update on this? – Chance Sep 12 '18 at 20:17

Are you trying to update IsDelete field from cose in trigger? If so can you just use delete dml on such objects where you want to set IsDelete as true.

  • That's an immutable system field.. – Mossi Nov 17 '15 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.