-
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, 6 months ago by
Deepak.
-
This discussion was modified 6 years, 6 months ago by
Log In to reply.
Popular Salesforce Blogs
Best Salesforce Implementation Partner and Consulting Company in the USA
Introduction: In today's fast-paced business landscape, staying ahead of the competition requires innovative strategies and cutting-edge technologies. Salesforce, as the world's leading customer relationship management…
Top 5 Use Cases of Salesforce Partner Portal
Struggling to work together with external partners on projects? A Salesforce partner portal is your solution! These portals act as a central hub for your…
What is Salesforce Scheduler in 2024?
In today's fast-paced business landscape, managing schedules and appointments can be a labyrinth of complexity, impacting customer experience and operational efficiency. Salesforce Scheduler is the solution for…
Popular Salesforce Videos
Generate the Multiple Contracts in Salesforce CPQ
In this video, watch a demonstration of how to generate multiple contracts using a single quote record. Watch and learn. Do let us know in…
Are they secure enough ? Web to Lead Forms | Validations | SPAM | CAPTCHA | Salesforce Tutorials
Are you using web to lead forms ? Do you think it's secure enough ? In this video you will get all your answers. And…
Rollup Trigger via Salesforce Record Triggered Flow - Trigger without code
Hello Folks, I created a Rollup trigger via Salesforce Record Triggered Flow (without code cool isn't). I use Record trigger Flow for that scenario. There…
Popular Salesforce Infographics
How to Integrate Salesforce with External Systems
Salesforce Connect empowers you to associate Salesforce to external heritage frameworks like Oracle, SAP, DB2, Microsoft SharePoint continuously, without making a duplicate/copy of any single…
Average Salesforce Salaries 2019
This Infographic gives Salesforce professionals an idea about where they sit in the market and what salary they can expect, using data from the Mason…
Success With Salesforce For Full Cycle Reps
I am presenting this infographic to help full cycle sales reps get the most out of salesforce and their Sales Engagement platform.