-> I have a field say Amount in Opportunity Object.
-> I have created a Validation Rule that If Amount is empty/null throw an error.
-> I have a workflow which will fire on creation of Opportunity, to empty the Amount field.
Now when I create an Opportunity, It creates a record with Amount field as empty.
-> Now I have created a trigger After Update Trigger, which will update another field in Opportunity, say a checkbox Revised Opportunity.
Now whenever I try to create an Opportunity there is an error caused due to trigger and after that validation rule.
I checked the debug log, I am able to see an Opportunity ID related to my newly created Opportunity and error message it displays in debug log is "Record is Read Only". I want to know how does this works? Does my record gets deleted(which I don't see in the log as being deleted) Or does the Process is not committed/rollback happens?
Because I tried creating an auto number(created two records with trigger as inactive and activated trigger and after two fails, I again inactivated the trigger and tried to save and found autonumber being incremented by 2) thinking that it won't get incremented in failing record save but auto number does get incremented. So, does it mean that my record is getting deleted in the Order of Execution?