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

Can I get some help in my trigger??



I need to write a trigger where if for a particular field the value isi.e. Stage__c = 'Changed'.. no new record should get created...



My Custom object name is Acc__c

Custom Field Name is Stage__c




You can prevent DML operation from happening using the Trigger.addError method


// check for the condition

if(condition){[0].Field_Name.addError("Your Custom message");