locked
Update all Opportunities when one is updated - avoid infinite loop RRS feed

  • Question

  • Hi I have a requirement to update certain field update on any given Opportunity P tied to Account A to be synced up to all Opportunities associated with the same parent Account A. I am planning to do that on the postOpportunityUpdate. But I am afraid this will cause a infinite loop. What is the best way to handle this scenario?
    Saturday, September 6, 2014 7:34 PM

All replies

  • Sunday, September 7, 2014 3:36 AM
  • Hi,

    In addition to Above post please check this also

    1. Write your Plugin on PostUpdate of the opportunity
    2.To avoid the infinite loop use 
     if(context.Depth == 1)
    {

      //update associated opportunities of Account
    }
    else{

    return;

    }

    3.In plugin Registration tool,select the filtering attributes(say p in your case)

    4.Note : Since this a post update of opportunity you cannot get the other attributes value in event pipeline
            use Post Image to get the value other attributes. 

    Regards


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Mohammad Yusuf Ansari http://microxrm.blogspot.in


    Monday, September 8, 2014 4:51 AM
  • Hi,

    Simply you can create one new field and use that as a flag means update that new field to yes also with your desired field.

    And you can use above flag as a filtered criteria in plugin.

    Also i think there is a limit of 5,000 records update via plugin and execution time will not more than 2 mins.


    Deepak Jangra

    Wednesday, September 10, 2014 11:32 AM