Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

how to declare entity reference in dynamics crm Azure function code

(0) ShareShare
ReportReport
Posted on by

Hi Guys,

AnyBody know how to declare entity reference in dynamics crm azure function coding. Here i write line for declare entity reference but itshowing error. My code is

       var accountType = ((EntityReference)appl.Attributes["new_requestedroleid"]).LogicalName;

But it Showing System.colletion.generics exception error occur in that line..i don't know why it is happening..can u please tell me how to declare entity reference and get the name filed value from the lookup field record.

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: how to declare entity reference in dynamics crm Azure function code

    Hi Dinesh,

    There is nothing specific you need to do for Azure functions. The error (if I am not wrong) must be key error which means the object appl doesn't have the attribute with the name "new_requestedroleid".

    Hope this helps.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans