locked
Question For Plugin Assign & SetState RRS feed

  • Question

  • In CRM4.0 we use plugin instead of callout inCRM3.0,now I have some problem for assign & setstate.

    For example

    Entity Opportunity:
    Now I want to do something when user assign a record to another user. In CRM3.0 we use callout (Pre/Post)Assign function and write code in the function config the Dll and then we can do something what we want when we assign a record.
    In CRM4.0 I use Plugin Registration Tool set message field Assign I tried Pre and Post State to config the code But in CRM when I assign record nothing happen.  Also the same instance for (Pre/Post)SetState I close an opportunity the state is change but nothing happen.

    Plugin Registration tool
    I can use the (Pre/Post)Create & Update it's allright. Assign & SetState is not run.
    Why this thing happen? In CRM If I want to do something when  I  (Pre/Post) assign or  close  a  record what shall I do?
    Wednesday, May 7, 2008 6:24 AM

Answers

  • In the child pipeline the ownerid is passed as the owninguser attribute, not the ownerid.

     

    I've now realised that I can get the plug-in to register on the Assign message, and it now works fine for me on the parent pipeline with the Assign message (my problem was an error in my plug-in registration)

    Friday, May 9, 2008 4:03 PM
    Moderator

All replies

  • It looks like CRM doesn't actually use the Assign message when assigning an entity; instead it looks like it uses an Update message. Not only that, but I can't see the new owner anywhere in the input parameters on the parent pipeline, but it is there on the child pipeline.

     

    So, it looks like your best bet is to register the plugin on the Update message on the child pipeline

     

    Thursday, May 8, 2008 9:43 AM
    Moderator
  • An assign can be done using one of two messages: Assign or Route. The CRM Web application issues a Route message to do an assign. You should register your plug-in in the parent pipeline for both messages. We are adding this information to the next release of the SDK since this issue comes up a lot.

     

    A state change can be done using one of two messages: SetState or SetStateDynamicEntity. You should register your plug-in in the parent pipeline for both messages. If that does not work, try registering the plug-in in the child pipeline for an Update message.

     

    PeterH

     

    Thursday, May 8, 2008 5:03 PM
  • David
       I use update message and set child pipeline in code

       entity = (DynamicEntity)context.InputParameters.Properties["Target"];
       the return for "entity.Properties.Contains("ownerid")" is also false I can,t find the Ownerid for the owner lookup field

       you say you can find the owner can you description how do you config you plugin tool parameter
    Friday, May 9, 2008 1:58 AM
  • Tech Writer
             I register both two messages: Assign and Route for opportunity entity  parent pipeline but in crm when I assign opportunity record nothing is happen.State change is also
    Friday, May 9, 2008 2:04 AM
  • In the child pipeline the ownerid is passed as the owninguser attribute, not the ownerid.

     

    I've now realised that I can get the plug-in to register on the Assign message, and it now works fine for me on the parent pipeline with the Assign message (my problem was an error in my plug-in registration)

    Friday, May 9, 2008 4:03 PM
    Moderator
  • Tech Writer

    Thanks for the information about use of Assign/Route, but surely that only can only apply to the activity and incident entities, as those are the only ones that support the Route message

     

    David 

     

    Friday, May 9, 2008 4:10 PM
    Moderator
  • Another problem how can I registration the message If I want to add some code when I set the state to close?

    I set the  parent pipeline with the
    SetState message  when I close the record nothing happen.
    Monday, May 12, 2008 5:42 AM
  •  

    Yes, you are correct. I just read the post too fast! I will have to slow down some. I was working an issue from someone else who could not get their plug-in to fire for an assign of an activity.

    Monday, May 12, 2008 11:23 PM
  • dear might be this will help you

     

    http://blogs.msdn.com/crm/archive/2008/05/12/testing-crm-plug-ins.aspx

     

    Regards,

    Imran

     

     

    Tuesday, May 13, 2008 8:42 AM
    Moderator