-
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
MuleSoft Composer for Salesforce
MuleSoft Composer for Salesforce is the fastest and easiest way for non-developers to connect third-party applications and data to Salesforce using clicks, not code. No more…
Salesforce Workflow Vs Process Builder in Salesforce
Workflow Rule By using Workflows we can: 1) Update a field 2) Send an email 3) Create a Task 4) Send an outbound message Don’t…
Content Object | Salesforce
Agenda Data Model Content Document Content Version Content Workspace Content Workspace Doc Developer Support Data Model Content Document Represents a document that has been uploaded…
Popular Salesforce Videos
Salesforce Service Cloud Voice Demo
Salesforce Service Cloud Voice uses intelligent telephony to increase agent productivity and better serve customers, from anywhere. Today, customers can connect with companies across almost…
How Leadership Skills Helps to Shape Your Career? | Salesforce Learning
Leadership is an important skill to have because a good leader is able to bring out the best abilities in his/her team members and motivate…
Salesforce Admin Certification 2020 Questions Explained with References - Part I
How to prepare and pass Salesforce Admin Certification with Practice Exam Questions 2020 practice questions and answers for the Salesforce Administration Salesforce Certified Admin Exam…
Popular Salesforce Infographics
Salesforce's Take On Sales vs Marketing [Infographic]
Let’s face it: you don’t need to be watching HBO’s acclaimed series Game of Thrones to see a rivalry like the Starks and Lannisters. A…
What is the Significance of Salesforce Implementation in Business Growth?
Salesforce is the CRM or Customer Relationship Management software that is used to manage several business operations. Companies use Salesforce to manage and improve their…
How To Upgrade Your Business With Salesforce?
Salesforce has been stretching the possibilities of business growth right from its inception in 1999. Its fierce business model attracted people who eventually moved to…