function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Saddam Hussain 85Saddam Hussain 85 

How to assign owner of a record to Integration user using apex when status is set to restrict on Account object

Got an error with this codeGot an error with this code. Please help
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Saddam,

Can you confirm what error did you face . Is it error while saving the record or while the apex is running.

Thanks,'
 
Saddam Hussain 85Saddam Hussain 85
Getting error while saving the record
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Saddam,

Can you share the error and also when is this method called  so it would be easy to identify the issue.

Thanks,
 
Saddam Hussain 85Saddam Hussain 85
User-added image
this is the error which I am getting while saving a record.
I want to create a trigger with condition as:
whenever status is set to restrict the record owner should change from current owner to Integration user, and
whenever status is set to delete the record should get hard-deleted