-
Is there any need of map when we can insert & update using List only in contact mailing address?
trigger update_MailingAddress on Contact(before insert,before update) { set<id> accountIdset=new set<id>(); for(Contact con:trigger.new){ if(con.AccountId!=null){ accountIdset.add(con.AccountId); } } list<account> accList = [select id,billingCity,billingState,billingStreet,billingCountry from Account where id iN : accountIdset]; for(Account acc : accList){ for(contact con :trigger.new) { con.MailingCity = acc.billingCity; con.MailingState = acc.billingState; con.MailingStreet = acc.billingStreet; con.MailingCountry = acc.billingCountry; } } }-
This discussion was modified 6 years, 7 months ago by
Deepak.
-
This discussion was modified 6 years, 7 months ago by
Log In to reply.
Popular Salesforce Blogs
Strategies for Finding Your Salesforce Training Plan
The company and staff should know why Salesforce is vital. After training, don’t presume that the why is the exact same for all classes. Senior…
How to Stop a Journey in Salesforce Marketing Cloud
It was time-consuming to pause Salesforce Marketing Cloud's progress. It will provide you with tips to help you save money while still achieving them. Marketing…
How Can You Get High Output With Salesforce DX and Enjoy Lots of Benefits
What is it that has driven app developers crazy after Salesforce DX? There must be some important reasons and features in it, which makes it…
Popular Salesforce Videos
Dreamforce 2021 Main Keynote - Welcome to the Trusted Enterprise | Salesforce
Today, every business has to transform to become a Trusted Enterprise. Join Marc Benioff & special guests to learn how Customer 360 helps businesses of…
How To Use Dynamic Prefill Link of Formstack | Learn Salesforce Series by Algoworks
Learn how to use ‘Dynamic Prefill Link’ of Formstack in 4 easy steps! 1. Introduction Short introduction of FormStack and its uses. 2. The need…
Contact Deletion in Salesforce Marketing Cloud
Cameron Robert from Datarati talks through how the Contact Delete function works, how to use it, and a practical demo of how to build a…
Popular Salesforce Infographics
How Customer Experience Is Rewriting the Rules of Business Success
Your guide to customer experience - Customers expectations are changing. And as they change, businesses face sky high standards for delivering customer experience that's a…
Pardot January 2020 Release [Infographic]
HML Personalisation on Landing Pages and Forms What: HML is the new way to add personalization to Pardot marketing assets, replacing variable tags – you…
6 Tips to Evaluate the Right Salesforce QA Vendor
Salesforce is the ultimate customer success platform, which makes it important to choose the right partner for your Salesforce project especially because it governs your…