You need to sign in to do that
Don't have an account?
Dagny Fernandes
getting error: FIELD_CUSTOM_VALIDATION_EXCEPTION
Hi Frends,
Iam getting the bellow error:
TicketStatus: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0AO000000Ak6Y6MAJ; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, This profile cannot edit this escalation the tickets are raised: [] Class.TicketStatusHandler.onAfterUpdate: line 229, column 1 Trigger.TicketStatus: line 37, column 1
There is requirement like i have a parent record and child records, the child record as a self lookup relation to parent record.
Here the parent record is escaltion and child record is ticket.
The above error is comeing while editing the ticket because There is a validation on the parent record(Escaltion) based on profile. the validation is
Ex: IF Ticket is raised for the respaective Escalation then the BA profile cannot edit the Escaltion. But can edit the Ticket, based on ticket value from trigger escaltion is updated, here it comes the above mentioned error.
How can i overcome from this problem need help.
Thanks in advance,
Iam getting the bellow error:
TicketStatus: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0AO000000Ak6Y6MAJ; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, This profile cannot edit this escalation the tickets are raised: [] Class.TicketStatusHandler.onAfterUpdate: line 229, column 1 Trigger.TicketStatus: line 37, column 1
There is requirement like i have a parent record and child records, the child record as a self lookup relation to parent record.
Here the parent record is escaltion and child record is ticket.
The above error is comeing while editing the ticket because There is a validation on the parent record(Escaltion) based on profile. the validation is
Ex: IF Ticket is raised for the respaective Escalation then the BA profile cannot edit the Escaltion. But can edit the Ticket, based on ticket value from trigger escaltion is updated, here it comes the above mentioned error.
How can i overcome from this problem need help.
Thanks in advance,
This solved the class was writen under "with sharing" i removed the with sharing it started updateing the record nw the code runs under system admin profile
All Answers
try{
update accounts;
} catch (DMLException e){
for (Account account : accounts) {
account.addError('There was a problem updating the accounts');
}
} finally {
inProgress = false;
}
Refer the below url for more info.
https://developer.salesforce.com/page/An_Introduction_to_Exception_Handling
But i wanted this update to be happen in the back end
This solved the class was writen under "with sharing" i removed the with sharing it started updateing the record nw the code runs under system admin profile