You need to sign in to do that
Don't have an account?

Populate values
Hi All
1. I have create custom user lookup field in Account ,field name"SalesRep"
2.create custom Account lookup field in Site custom object,field name "Main Builder"
3.and also create custom user lookup field in Site custom object,field name "Exo SalesRep"
when i select account in "Main Builder" ,the relevant account user name will be populate in "Exo SalesRep" field.
Plz anyone solve the issues
Advance thanks
{
list<account> listaccount=new list<account>();
map<id,id> mapaccount=new map<id,id>();
for(site s:trigger.new)
{
listaccount.add(s.accountid,);
}
list<account> acc=[select user__c,name from account where id in:mapaccount];
for(account ac:acc)
{
mapaccount.put(ac.id,ac.user__c);
}
for(site s:trigger.new)
{
s.user__c=mapaccount.get(s.accountid);
}
}
or you can use workflow for this also ....