locked
Message in Plugin registration for Fulfilled Order in CRM 2011 RRS feed

  • Question

  • Hi All,

    I had customized a plugin to do some validation on the sales order form to enforce user to enter into some field before they can fulfill order. Previously I did the same for phone call activity and manage to get it work by register the plugin step with message SetStateDynamicEntity.

    However I tried the same way for the new plugin for sales order form, but the plugin didn't get trigger. How can I check whether the user is fulfilling the order by using the message in plug in registration? I also tried SetState, but it still not get fired the plugin.

    Other than using Update message, how to make it work?

    Thanks.

    Regards,
    Teh 

    Monday, January 9, 2012 6:36 PM

Answers

  • Hi,

    Have you tried OrderClose entity with Create message, and PreValidation Stage, I am not sure this will work, just a guessing since OrderClose records details when a sales order get fulfilled.

     

     


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Edited by Thomas Thankachan Tuesday, January 10, 2012 4:47 AM update
    • Proposed as answer by Sam - Inogic Tuesday, January 10, 2012 5:46 AM
    • Marked as answer by Teh Tuesday, January 10, 2012 4:06 PM
    Tuesday, January 10, 2012 4:37 AM
  • Looking at the SDK i found a request FulfillSalesOrderRequest. I guess this is the request that is being used to fulfill the order from UI and so the SetState does not fire.

    Further it is also written that a user needs privilege for Order Close to perform Fulfill Order request... so probably Thomas's suggestion to trap Pre-Create or Order Close might help. But again... you need to check, because by the time the order close is created, probably the Order is already fulfilled...

    But then it is also the case that if you throw an error from Pre-Create order close and it is all within a transaction, the fulfill order message may also rolll back...

    Thinking out loud... worth a try...

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

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


    You can perform validation in Pre-create plugin on OrderClose entity as mentioned by Thomas T  because Sales Order status does not change until OrderClose record is created successfully.

    Thank you.

    JayshriP

    • Marked as answer by Teh Tuesday, January 10, 2012 4:05 PM
    Tuesday, January 10, 2012 12:47 PM

All replies

  • It is definitely a state change. Register your plugin on both SetState and SetStateDynamicEntity.

    It should work.

    I hope this helps.


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com
    Monday, January 9, 2012 10:35 PM
  •  

    You can register your plugin against OrderClose entity with SetState & SetStateDynamicEntity messages

     

     


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Tuesday, January 10, 2012 1:13 AM
  • It is definitely a state change. Register your plugin on both SetState and SetStateDynamicEntity.

    It should work.

    I hope this helps.


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com

    I tried register both setstate and setstatedynamicentity against salesorder entity, but it doesn't work.... :(
    Tuesday, January 10, 2012 3:12 AM
  •  

    You can register your plugin against OrderClose entity with SetState & SetStateDynamicEntity messages

     

     


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".


    It is not working either...... i'm not sure why it is not triggered......
    Tuesday, January 10, 2012 3:12 AM
  • Hi,

    Have you tried OrderClose entity with Create message, and PreValidation Stage, I am not sure this will work, just a guessing since OrderClose records details when a sales order get fulfilled.

     

     


    Thomas T(MCBMSS) If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Edited by Thomas Thankachan Tuesday, January 10, 2012 4:47 AM update
    • Proposed as answer by Sam - Inogic Tuesday, January 10, 2012 5:46 AM
    • Marked as answer by Teh Tuesday, January 10, 2012 4:06 PM
    Tuesday, January 10, 2012 4:37 AM
  • Looking at the SDK i found a request FulfillSalesOrderRequest. I guess this is the request that is being used to fulfill the order from UI and so the SetState does not fire.

    Further it is also written that a user needs privilege for Order Close to perform Fulfill Order request... so probably Thomas's suggestion to trap Pre-Create or Order Close might help. But again... you need to check, because by the time the order close is created, probably the Order is already fulfilled...

    But then it is also the case that if you throw an error from Pre-Create order close and it is all within a transaction, the fulfill order message may also rolll back...

    Thinking out loud... worth a try...

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

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

    • Proposed as answer by Sam - Inogic Tuesday, January 10, 2012 5:46 AM
    Tuesday, January 10, 2012 5:45 AM
  • Looking at the SDK i found a request FulfillSalesOrderRequest. I guess this is the request that is being used to fulfill the order from UI and so the SetState does not fire.

    Further it is also written that a user needs privilege for Order Close to perform Fulfill Order request... so probably Thomas's suggestion to trap Pre-Create or Order Close might help. But again... you need to check, because by the time the order close is created, probably the Order is already fulfilled...

    But then it is also the case that if you throw an error from Pre-Create order close and it is all within a transaction, the fulfill order message may also rolll back...

    Thinking out loud... worth a try...

    Sam


    Dynamics CRM MVP | Inogic | http://inogic.blogspot.com| news at inogic dot com

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


    You can perform validation in Pre-create plugin on OrderClose entity as mentioned by Thomas T  because Sales Order status does not change until OrderClose record is created successfully.

    Thank you.

    JayshriP

    • Marked as answer by Teh Tuesday, January 10, 2012 4:05 PM
    Tuesday, January 10, 2012 12:47 PM
  • I had use Create message with orderclose entity, however still not working.......

    Tuesday, January 10, 2012 3:24 PM
  • Hi,

    finally it is working now.......

    Need to register under Preoperation instead of pre validation with Create message.

    Thanks guy!!!

    Tuesday, January 10, 2012 4:06 PM
  • Thanks lots! This solved my problem too. May the good karma pixies help you on your way :)
    Thursday, October 4, 2012 11:18 PM