When an Account is updated and the Website is filled in, update all the Profile field on all Contacts to: Profile = Website + ‘/’ + First Letter of First Name + Last Name
We are getting the value of the Website field from the SOQL query instead of trigger.new context variable. So, from the Database the updated value should be fetched that's the reason first we need to commit the update then fetch it to use.
I think we should add the above underlined logic to increase the usuability the code properly. Beacuse otherwise everytime we update any other field then also it will override the same value on the Profile field.
I can't help but share a great experience with this platform! Real professionals from Europe are gathered here and my project was done perfectly https://devler.io/. Impressive not only the quality of work, but also the scale of the client base around the world. Join, you won't regret it!
Please use below code it works fine and without nested loop:
Trigger:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
All Answers
Try this code for above requirement
Hope this helps you
If this helps you kindly mark it as solved so that it may help others in future.
Thanks and Regards
but this code has a nested loop i think
Please use below code it works fine and without nested loop:
Trigger:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
can you please explain the working of this code
Hi Ajay,
I think we should add the above underlined logic to increase the usuability the code properly.
Beacuse otherwise everytime we update any other field then also it will override the same value on the Profile field.
Suggestions are most welcome.
Thanks & Regards,
S Bishal