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
MaxxMaxx 

Can I get some help in my trigger??

Hello,

 

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

 

 

Arijit_rArijit_r

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

 

// check for the condition

if(condition){

   Trigger.new[0].Field_Name.addError("Your Custom message");

}