You need to sign in to do that
Don't have an account?
SunilKumar
Trigger Lookupfield update
Hi I Have a requirement
I have Account object and B is the custom object , Here My question is Account having the self lookup relation with the name of city(its a lookup field) and in Account object only state(picklist ) is there with few values a,b ,c, I want when ever user insert or update the record and by selecting the picklist value a , Automatically the a is populate in the city (i mean in lookup filed),
I don't want do this one with pointand click , Do this one trigger only
Please give me reply
Thanks
I have Account object and B is the custom object , Here My question is Account having the self lookup relation with the name of city(its a lookup field) and in Account object only state(picklist ) is there with few values a,b ,c, I want when ever user insert or update the record and by selecting the picklist value a , Automatically the a is populate in the city (i mean in lookup filed),
I don't want do this one with pointand click , Do this one trigger only
Please give me reply
Thanks
Thanks
Manoj
B__c custom object
State__c picklist
city__c is lookup apinmae
set<id> accids= new set<id>();
for(contact a:trigger.old){
accids.add(a.id);
}
list<contact> conlist =[select id,description,box__c,picklist__c
from contact
where id in: accids];
for(contact c: conlist){
c.box__c=c.picklist__c;
}
update conlist;
}
in theabove code box__c is acommon firld, and picklist__c is picklist field
Please do the after update event,
Apex trigger ContactCreation1 caused an unexpected exception, contact your administrator: ContactCreation1: execution of AfterUpdate caused by: System.StringException: Invalid id: