You need to sign in to do that
Don't have an account?
javierjies
Update with a Trigger
Hello everyone!!
I've an object called Expediente__c, where I have two fields; Cerrado__c (It's a Checkbox) and Situacion__c (It's a text field)
I want to develop a trigger to make automatically an update, I mean, if Cerrado__c changes to False, I want Situacion__c='Cerrado'
any idea?!?!? thanks!!
Hi javierjies,
use a before trigger and just check if cerrado__c is false (and maybe wasn't before) and if so set the Situacion__c field.
for(Expediente__c data : trigger.new) { if(!data.cerrado__c) // need to check here too if you want to check old Value { data.Situacion__c = 'Cerrado'; } }
Because of the before trigger the change will be set without updating anything.