web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

context.InputParameters[“RelatedEntities”] is not an EntityReferenceCollection

(0) ShareShare
ReportReport
Posted on by 2,541

Hello everyone,

I'm facing a strange "issue" today.
When associating / diassociating records, i'm sending message to our Service Bus  for further process.
During the retrieving process of this message, i correctly have my "Target", "Relationship" and "RelatedEntities" properties in my InputParameters : 

2017_2D00_04_2D00_24_5F00_12_2D00_14_2D00_54_2D00_devenv.png

Problem as you can see on the screenshot is my RelatedEntities is an object.
According to some blogs read (ex : https://community.dynamics.com/crm/b/mscrmshop/archive/2012/05/14/how-to-trigger-a-plugin-for-many-to-many-relationship), i can't convert my object into an EntityReferenceCollection, this is returning me a null value :

 2017_2D00_04_2D00_24_5F00_12_2D00_18_2D00_06_2D00_devenv.png

Does anyone have an idea here ?

Thanks a lot,

Clément

*This post is locked for comments

I have the same question (0)
  • ashlega Profile Picture
    34,477 on at

    Hi Clement,

     just out of curiosity, what's the actual type of that parameter then?

     Could you try something like plugin.InputParameters["RelatedEntities"].GetType.ToString()

  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    The type EntityReferenceCollection is correct for RelatedEntities, for associate/disassociate operation.

    I am not sure why it is null.

  • Verified answer
    Clem Profile Picture
    2,541 on at

    I found a workaround here.

    Instead of casting it into EntityReferenceCollection as it should  be (maybe caused by the transfer of data to Service bus ?), i'm casting it into an Array then i can do a simple foreach(EntityReference er into myobjectarray)

    Clément

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans