Thursday, December 13, 2012

Preventing Recursive Method Calls in Salesforce

Hello Guys,
        Yesterday i was playing with salesforce custom object. I had task to update the object once particular field get updated /inserted (for same object). 

Eg. I have Student__c is custom object on salesforce.

Structure of Student__c object is like:
Id, Name__c, Score_in_maths__c, Score_in_science__c, Total_score__c

So when trying to update any score value required to update Total_score__c  accordingly.  To fulfill  this i have added trigger on Student__c (after update) but it results as recursive loop.

To overcome above issue just followed the steps mention in http://blog.jeffdouglas.com/2009/10/02/preventing-recursive-future-method-calls-in-salesforce/. And it works for me.

Free feel to leave comment or ask queries. :)

No comments:

Post a Comment