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

I have created two custom objects(customobj1__c ,customobj2__c) with no relation between them and in customobj1 i created two picklist values (1,2,3 on each filed) and on other object i created 1 picklist value (a, b , c, as values )...here is my code.
trigger customtrigger on customobj1__c (after insert) {
customobj2__c cus2=new customobj2__c();
for(customobj1__c cus:trigger.new)
{
if(cus.field1__c=='1' && cus.field2__c=='1')
{
cus2.updatefield__c='a';
}
else if(cus.field1__c=='2' && cus.field2__c=='2')
{
cus2.updatefield__c='b';
}
else if(cus.field1__c=='3' && cus.field2__c=='3')
{
cus2.updatefield__c='c';
}
}
insert cus2;
problem here is how to get picklistvalues from obj2..and how to update picklist value in customobj2..?
customobj2__c cus2=new customobj2__c();
for(customobj1__c cus:trigger.new)
{
if(cus.field1__c=='1' && cus.field2__c=='1')
{
cus2.updatefield__c='a';
}
else if(cus.field1__c=='2' && cus.field2__c=='2')
{
cus2.updatefield__c='b';
}
else if(cus.field1__c=='3' && cus.field2__c=='3')
{
cus2.updatefield__c='c';
}
}
insert cus2;
problem here is how to get picklistvalues from obj2..and how to update picklist value in customobj2..?