You need to sign in to do that
Don't have an account?

If a user changes Phone in Account then its Contacts Phone should get updated with new value, only if the Contact Phone was same as account's old Phone value.
Please help me write a trigger and class for the same.
Try this code :
Please let me know how it works out for you.
Please mark this question as Solved if this answers your question so that others can view it as a proper solution.
Thanks,
Apoorv
All Answers
Try this code :
Please let me know how it works out for you.
Please mark this question as Solved if this answers your question so that others can view it as a proper solution.
Thanks,
Apoorv
You can achive this using process builder, please follow below steps:
- Create Process builder on Account
- Set Criteria - Formula evaluates to true and use below formula
- And( !(IsNew()),!( PRIORVALUE( [Account].Phone )= [Account].Phone))
- If formula True, Then write Field update action
- Select "Criteria for Updating Records*" as "Updated records meet all conditions"
- Write below value in Filter the records you update based on these conditions
- Mobile Phone --> Equals --> Formuala --> ( PRIORVALUE( [Account].Phone )
- Write Below value in "Set new field values for the records you update"
- Mobile Phone --> Reference --> [Account].Phone
With above solution you will be able to achieve your output without writing code.Let me know if this solve your problem.
Thanks
Thanks