locked
Custom workflow input Argument as PartyList RRS feed

  • Question

  • Dear All,

    In my custom workflow (CRM 2011) I need to pass the input parameter as  PrityList (Multiselect Look Up filed).

    I need only contacts and Users records as input parameter in a single look up.

    How I will do?

    Regards,

    Priya.

    Friday, May 18, 2012 6:30 AM

Answers

  • Priya,

    Unfortunately you cannot pass in the PartyList as an Input Argument into your custom workflow activity.

    The list of supported argument types can be found on this link http://msdn.microsoft.com/en-us/library/gg327984.aspx

    What you can do is instead of passing the PartyList, you can pass in an EntityReference of the main record that contains the PartyList.

    Then, you can query the party list data easily from within your custom workflow activity.

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.


    Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits

    Friday, May 18, 2012 6:37 AM
  • Hi Priya,

    Yes you can. It will look something like this.

    [Input("Input Contact")]
    [ReferenceTarget("contact")]
    public EntityReference InputContact { get; set; }
    
    [Output("Output Contact")]
    [ReferenceTarget("contact")]
    public EntityReference OutputContact { get; set; }

    To get and set the values from Input / Output parameters, you can do something like this.

    // Get the value from Input Parameter
    var contact = InputContact.Get<EntityReference>(executionContext);
    
    // Set the value into Output Parameter
    OutputContact.Set(executionContext, contact);

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.


    Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits


    Friday, May 18, 2012 7:06 AM

All replies

  • Priya,

    Unfortunately you cannot pass in the PartyList as an Input Argument into your custom workflow activity.

    The list of supported argument types can be found on this link http://msdn.microsoft.com/en-us/library/gg327984.aspx

    What you can do is instead of passing the PartyList, you can pass in an EntityReference of the main record that contains the PartyList.

    Then, you can query the party list data easily from within your custom workflow activity.

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.


    Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits

    Friday, May 18, 2012 6:37 AM
  • Hi Dimaz Pramudya,

    Thanks for your Valuable time .

    Can we give the input and output parameter as same entity reference?

    Like one contact entity as input and same contact entity as output?

    Friday, May 18, 2012 7:02 AM
  • Hi Priya,

    Yes you can. It will look something like this.

    [Input("Input Contact")]
    [ReferenceTarget("contact")]
    public EntityReference InputContact { get; set; }
    
    [Output("Output Contact")]
    [ReferenceTarget("contact")]
    public EntityReference OutputContact { get; set; }

    To get and set the values from Input / Output parameters, you can do something like this.

    // Get the value from Input Parameter
    var contact = InputContact.Get<EntityReference>(executionContext);
    
    // Set the value into Output Parameter
    OutputContact.Set(executionContext, contact);

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.


    Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits


    Friday, May 18, 2012 7:06 AM
  • Thanks a lot.
    Friday, May 18, 2012 8:28 AM