locked
Plugin to sum totals on state change, can't get plugin to work RRS feed

  • Question

  • I'm trying to update a rollup field on the account form for the total number of opportunities that account has. I have registered my plugin on the create and update message and for the post-operation pipeline. It all works on those messages but when I change the state of n opportunity from open to close the plugin doesn't fire and run the fetchxml code. What am I doing wrong?
    Saturday, March 29, 2014 11:42 AM

All replies

  • Hi Sedb.DD,

    For your Plugin to fire on state change, you need to register the Plugin in "SetState" and "SetStateDynamic" Messages as well. 


    Admin QuikView Solution for CRM 2013

    Saturday, March 29, 2014 11:58 AM
  • Hi, I've done that however, in the pre-operation stage - it fires but the total count is incorrect because nothing has been written to the DB. In the post-operation stage, it can't find the current record as the state has changed, so there is an error. I'm stuck in a loop.
    Saturday, March 29, 2014 12:00 PM
  • Use post-operation and remove the 'active' filter from your query. You already have the ID of the opportunity, so you shouldn't need to use any additional filters to get it.

    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Sunday, March 30, 2014 12:55 AM