You need to sign in to do that
Don't have an account?
WannabeDeveloper
How to map multi-select picklist from Account to Contract?
I desperately need to map some custom fields from the Account to a Contract. How would I go about writing this code? I can't find anyone who is doing this, but I'm sure it can be done, if someone can help me with the code, or and idea outside of the box! Please help!!!!!
Hi,
Here is some similar trigger except it send data from account to opportunity
Hope this helps you get started.
Kr,
Fred
Please find below the sample trigger :
//if you are updating Account object
trigger AftrUpdate on Account (after update)
{
if(Trigger.isAfter)
{
for(Account objAcc:Trigger.new)
{
for(Contract objCntrct:[select Id,Type__c,AccountId from Contract where AccountId= :objAcc.Id])
{
objCntrct.Type __c=objAcc. Type __c;
update objCntrct;
}
}
}
}
//if you are in Contract object
trigger Test_Contract on Contract (before insert)
{
if(Trigger.isBefore)
{
for(Contract objCntrct:Trigger.new)
{
String strHobbies = [select Type__c from Account where id= :objCntrct.AccountId].Hobbies__c;
objCntrct. Type __c=strHobbies;
}
}
}
Hope this helps.