function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
trigger UpdateAccEmailOnCase on Case (before insert) { set<id> accids = new set<id>(); for(case c : trigger.new){ if(c.accountid != null){ accids.add(c.accountid); } } list<account> lstAccs = [select id,name,Email__c from account where id in : accids]; map<id,account> mapAccData = new map<id,account>(lstAccs); for(case c : trigger.new){ if(c.accountid != null && mapAccData.containsKey(c.accountid)){ c.email__c = mapAccData.get(c.accountid).Email__c; } } }
Please check following sample code :
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com