locked
plugin retrieve message is fires more than once RRS feed

  • Question

  • Hi experts,

    This is for Dyn crm 2016 on premise.

    I created a plugin and registered it on "account, post, synchrone and retrieve"

    when I open an Account form the plugin is called 3 times and if i refresh the account form it is called 6 times. 

    Why is that , I expected it to be called only once?

    I'm working on a out of the box installation, so I didn´t change anything on the form.

    best regards henrik


    --- Best regards Henrik Skydtsgaard


    Monday, November 7, 2016 9:43 PM

All replies

  • Hi,

    You may check the Depth to make sure your plugin get executes only 1 time. If Depth is less than 1 then Execute the code else simply return. Please see the below code.


    if(context.Depth>1)
    {
    Return;
    }
    Else
    {
                    /*Your retrieve method call */
    }

    Hope this Help.

    Thanks!
    Sam


    Inogic | Blog | news@inogic.com

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Tuesday, November 8, 2016 10:18 AM