locked
Revise Quote plugin RRS feed

  • Question

  • We need to copy custom child records from the Quote once the revise action is completed.  Therefore, we've created a plugin which we've registered against the SetState and SetStateDynamicEntity messages of the Quote entity (both messages are registered in the Parent pipeline and on the Post event).

    Unfortunately, revising a Quote does not trigger our code to run, whereas activating a Quote only triggers the SetStateDynamicEntity message.

    Any idea which Quote messages we should be registering or what registration settings we are need to correct so that our plugin will be triggered by the revise action?  

    Thursday, April 22, 2010 12:39 AM

Answers

  • I haven't actually coded against Revise Quote action. But based on my preliminary investigation, you will need to hook into Create message, as CRM leaves the original quote as it is, and it duplicates a new quote based on the original one. 

    My first impression was SetState and SetStateDynamicEntity messages as well, but I trust what I witness than anything else. My sense is that the information from the two links was most likely wrong in the first place. 

    You are on the right track. If the Create message doesn't get triggered in Parent Pipeline, then it has to be in Child Pipeline. There is some implication when instantiating CRM Web Service Calls in child pipeline, but it's manageable if you have gone so far. :-)

    Cheers,


    Daniel Cai | http://danielcai.blogspot.com
    Thursday, April 22, 2010 9:25 PM

All replies

  • Believe it or not, every time you revise or activate a quote, it's actually creating a new quote, so you may need to hookup to create message. You may check "revisionnumber" property to see if it's a new quote or a revised quote. 

    In the case that you revise a quote, the original quote remains intact, but a new quote is created based on the original quote with the "revisionnumber" being incremented. 

    Hope this helps. 


    Daniel Cai | http://danielcai.blogspot.com
    Thursday, April 22, 2010 3:00 AM
  • Thanks, Daniel.   We actually have the logic to check the revision number, so we just need the the correct plugin Message to hook into.  We came across the posts below that recommended the SetState/SetStateDynamicEntity messages, but we couldn't get them to trigger off the Revise action of the Quote.

    http://social.microsoft.com/forums/en-US/crmdevelopment/thread/3040ab53-1675-4c4d-bca5-d1b57c05394d

    http://www.eggheadcafe.com/software/aspnet/32439036/revisequote.aspx

    However, it looks like the Create message is triggered in the child pipeline for the Revise action so we will modify our code to use this approach if this is the only triggering event we can use.

     

    Thursday, April 22, 2010 8:13 PM
  • I haven't actually coded against Revise Quote action. But based on my preliminary investigation, you will need to hook into Create message, as CRM leaves the original quote as it is, and it duplicates a new quote based on the original one. 

    My first impression was SetState and SetStateDynamicEntity messages as well, but I trust what I witness than anything else. My sense is that the information from the two links was most likely wrong in the first place. 

    You are on the right track. If the Create message doesn't get triggered in Parent Pipeline, then it has to be in Child Pipeline. There is some implication when instantiating CRM Web Service Calls in child pipeline, but it's manageable if you have gone so far. :-)

    Cheers,


    Daniel Cai | http://danielcai.blogspot.com
    Thursday, April 22, 2010 9:25 PM
  • I have meet the same requirements presented by Cipher by hooking into the child-context of the Create message to achieve "Cloning" and cross-revision maintenance of custom child records in relation to the Quote, Order, and Invoice. 
    Dave Berry
    Thursday, April 22, 2010 9:56 PM
    Moderator
  • Thanks David for the information. It looks that we all are on the same page now. :-)

    Cheers,


    Daniel Cai | http://danielcai.blogspot.com
    Thursday, April 22, 2010 10:18 PM
  • Cipher/Danie,

    Could you please share the code you used? I'm in the same bind you were in.

    Thanks!

    Wednesday, June 2, 2010 10:32 PM