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

Formula fields in trigger
Hi All,
Following is the error displayed when i use formula field in trigger:
Error: Compile Error: Field is not writeable: Potential__c.Contact_Status__c at line 5 column 4
trigger updatefield on Potential__c (after insert,after update)
{
for (Potential__c ptl:trigger.new)
{
if(ptl.Contact_Status__c='TRUE')
if(ptl.Opportunity_Stage__C!='CLOSED WON')
ptl.Opportunity_Stage__C='CLOSED WON';
}
}
Kindly advice as to what can be the error.
Many thanks in advance.
Hi,
Try this
trigger updatefield on Potential__c (after insert,after update)
{
for (Potential__c ptl:trigger.new)
{
if(ptl.Contact_Status__c==TRUE)
if(ptl.Opportunity_Stage__C!='CLOSED WON')
ptl.Opportunity_Stage__C='CLOSED WON';
}
}
Thanks,
Satheesh
Hello there, Yes you cannot update or writeable or over write a formula field via API
Hope this helps!
Hi Satheesh,
Thanks for the reply.
Regards
Aniroodha
Hi Pradeep,
Thanks for the update.
Regards
Aniroodha