You need to sign in to do that
Don't have an account?
Raju I 5
Error: Compile Error: expecting a semi-colon, found 'for' at line 10 column 19 when i am compering two object in if condition.if both same then it fallow as code
trigger test on Account (before insert, before update,after insert)
{
List<Customer_Info_Form__c> lst = new List<Customer_Info_Form__c>();
for(Account acc : trigger.new){
list<Customer_Info_Form__c> con= [ select Contact_Number__c,Email__c, Customer_Account__r.Name from Customer_Info_Form__c where
id in:trigger.new]
//Customer_Info_Form__c con = new Customer_Info_Form__c();
for(Customer_Info_Form__c c1 : con)
{
if(Customer_Account__r.Name== acc.Name )
{
c1.Contact_Number__c = acc.PersonMobilePhone;
c1.Email__c = acc.CG_Email_ID__c;
}
con.add(lst) ;
update lst;
}
}
{
List<Customer_Info_Form__c> lst = new List<Customer_Info_Form__c>();
for(Account acc : trigger.new){
list<Customer_Info_Form__c> con= [ select Contact_Number__c,Email__c, Customer_Account__r.Name from Customer_Info_Form__c where
id in:trigger.new]
//Customer_Info_Form__c con = new Customer_Info_Form__c();
for(Customer_Info_Form__c c1 : con)
{
if(Customer_Account__r.Name== acc.Name )
{
c1.Contact_Number__c = acc.PersonMobilePhone;
c1.Email__c = acc.CG_Email_ID__c;
}
con.add(lst) ;
update lst;
}
}
Try below code :
Please try below code :