CRM 2013 OnPrem : Get selected records from view in Workflow custom action C# RRS feed

  • Question

  • Hello,

    I have created one Dialog Process and I am running that using Javascript code when User Clicks on the Button on Ribbon.

    For example,

    1. User goes to Sales > Contacts > sees the default view for Active Contacts

    2. Then selecting few records from the View, and then clicking custom button on the Ribbon.

    3. Which starts the dialog and then runs custom workflow activity. (which is in C#)

    4. I want to get all the selected records in the C# workflow activity for further process.

    I know, I can use fetch xml query to get records.

    But how to get only selected records?

    Any idea?

    Thank you,


    For example my fetch xml looks like below, but which filter criteria I should use to get only selected records?
    <fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
      <entity name='contact'>
        <attribute name='fullname' />
        <attribute name='telephone1' />
           <attribute name='address1_line1' />
        <attribute name='address1_stateorprovince' />
        <attribute name='address1_city' />
           <attribute name='contactid' />
        <order attribute='fullname' descending='true' />
              <condition attribute='statecode' operator='eq' value='0' />

    Friday, June 26, 2015 5:44 AM

All replies

  • Hi Mittal,

    for this you can have actions in crm2013.

    in action you can select input parameter as string and send those selected records as string.

    can you try to see actions concept .

    it is great feature given in crm2013.

    kindly let us know for the feature help.


    Laxman P

    Monday, June 29, 2015 12:53 PM
  • The information about the selected records is only available client-side, and not passed to a custom workflow activity. To get the selected records from a grid, use a CrmParameter with Value=SelectedControlSelectedItemIds - see https://msdn.microsoft.com/en-us/library/gg309332.aspx?f=255&MSPPError=-2147217396

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Monday, June 29, 2015 1:12 PM