Tuesday 17 July 2018


Customize error message for trigger and display error message below the field

This Post demonstrates how to display error message in particular field level.

SObject SomeRecord;
SomeRecord.SomeField__c.addError('Custom Message');
//or
SomeRecord.someField__c.addError(someException);

Note:

We cannot add it to a field dynamically. This error mapping can only be done with a hard-coded field.

No comments:

Post a Comment