You need to sign in to do that
Don't have an account?
tsreenu92
Apex trigger error
trigger FieldUpdate on Customer__c (before insert,before update) {
if(Customer__c.MRRMonthly__c!=CustomerInfo__c.MRR__c)
{
Customer__c.MRRMonthly__c=Customer__c.MRR__c;
}
}
I am getting an error like this:
Error: Compile Error: Expression cannot be assigned at line -1 column -1. can any help me to solve this.
Hi,
Try the below code to work around to sort out your issue.
trigger FieldUpdate on Customer__c (before insert,before update)
{
for(Customer__c c:Trigger.new)
{
if(c.MRRMonthly__c!=c.MRR__c)
{
c.MRRMonthly__c=c.MRR__c;
}
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.