Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

How to pass a EntityCollection to a custom action?

Posted on by 417

Hello,

is it possible to pass a EntityCollection to a custom action logic? This

[RequiredArgument]
[Input("Sales Order")]
[ReferenceTarget("salesorder")]
public InArgument SalesOrders { get; set; }

or that

[RequiredArgument]
[Input("Sales Order")]
[ReferenceTarget("salesorder")]
public InArgument SalesOrders { get; set; }

leads to this error message in the registration process:

2275.2020_2D00_02_2D00_05-10_5F00_13_5F00_01_2D00_Publishing-Error.png

Sending the EntityCollection (as input argument) from the Javascript logic to the CRM process (custom action) works so far. But I need to send that data to be passed to the C# logic (workflow).

  • meelamri Profile Picture
    meelamri 13,204 User Group Leader on at
    RE: How to pass a EntityCollection to a custom action?

    Please close the thread by checking the answer as verified if the response is useful. Thank you.

  • bernhards Profile Picture
    bernhards 417 on at
    RE: How to pass a EntityCollection to a custom action?

    Great idea! Thank you very much for your help!

    Best regards,

    Bernhard

  • Verified answer
    meelamri Profile Picture
    meelamri 13,204 User Group Leader on at
    RE: How to pass a EntityCollection to a custom action?

    you're welcome. you can pass a string wish contains a list of Guids. Something like: "{xxxx,yyyy,zzzz}".

    In the back-end, split the string and get the Ids.

  • bernhards Profile Picture
    bernhards 417 on at
    RE: How to pass a EntityCollection to a custom action?

    Hello Mehdi,

    thanks for your answer. This means I have to send the selected entities from the frontend (JS, REST) one by one as EntityReference and there is no better/performant way?

    Thanks,

    Bernhard

  • Verified answer
    meelamri Profile Picture
    meelamri 13,204 User Group Leader on at
    RE: How to pass a EntityCollection to a custom action?

    EntityCollection is not supported in this case. Please check the doc: docs.microsoft.com/.../gg327984(v=crm.8)

    The following types are supported for custom workflow activities: Bool, DateTime, Decimal, Double, EntityReference, Int, Money, OptionSetValue, String.

    Mehdi,

    Please tick as verified if the answer is useful. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,902 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,302 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans