You need to sign in to do that
Don't have an account?
chikku
Avoid Null in Trigger.Old and Trigger.New in Trigger
When I track the old value and new value in the trigger, the first value showing has null, I don't know how to void it ..
I have used if ( Trigger.isbefore && Trigger.isUpdate) also I condition it doesn't work.
I have used if ( Trigger.isbefore && Trigger.isUpdate) also I condition it doesn't work.
if ( Trigger.isbefore ) for(integer i=0; i<trigger.new.size();i++){ if(Trigger.New[i].Decision_Determined__c!=Trigger.Old[i].Decision_Determined__c){ if(Trigger.Old[i].Plaid_Report_JSON__c==null){ Trigger.New[i].Plaid_Report_JSON__c=''; } Trigger.New[i].Plaid_Report_JSON__c +='\n Decision old value='+Trigger.Old[i].Decision_Determined__c+ ' Decision New value ' + Trigger.New[i].Decision_Determined__c; } } system.debug('-----old value'+Trigger.Old); system.debug('-----new value'+Trigger.New);
Which type of trigger is this? if you can share full code.
Thanks!
I did not clearly understand you question , let me know if its something else you are trying to ask.
I need to show old and new values when it updates the respective fields, if I use (Trigger.isUpdate) is not updating, nothing has been changed remains the same.
Try Below Code Please Mark It As Best Answer If It Helps
Thank You!
trigger. old is available only on the update and delete events.