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
Asad WaliAsad Wali 

HI Everyone. I hope you are all fine and doing great. I need help in trigger on after update. I want when i change address in my lead, if address change by user trigger call and update my one custom field which apn__c. Thanks in Advance

HI Everyone.

I hope you are all fine and doing great.

I need help in trigger on after update.

I want when i change address in my lead, if address change by user trigger call and update my one custom field which apn__c.

Thanks in Advance

ShirishaShirisha (Salesforce Developers) 
Hi Asad,

Greetings!

This can be achieved by using an automation process without using any code.I would suggest you to create the workflow rule/process builder to update the field on the Lead Object whenever the Address field changed.

You can simply use the criteria as ISCHANGED(Address)=true then update the apn__c to somevalue in the process builder.

Reference:https://help.oncehub.com/help/using-salesforce-workflow-rules-to-update-fields-based-on-scheduleonce-data

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Asad WaliAsad Wali

Hi Shirisha Pathuri

Thanks for your Response.

I hope you underatnd my actual problem ill chek your suggestion.

When i update lead i get error on future method.

Update failed. First exception on row 0 with id 00Q2x00000CZm0tEAD; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TriggerOnLead: execution of AfterUpdate

 

I fetch data from API and when my lead update so it update my custom filed apn__c in my lead. When i use trigger after update i get this error on futute method.

Regards