cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LeeHarris
Solution Sage
Solution Sage

How to Access EntityReference?

Hi,

I have created a component which I have bound to a field on a form within Dynamics 365. I was trying to get the current record id and found documentation on the EntityReference object here https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/entityreference

 

However, I'm struggling to find samples of how to pass this into my component so that I can access the record id? Has anyone got the steps necessary to get this implemented?

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

1 ACCEPTED SOLUTION

Accepted Solutions
a33ik
MVP

Hello,

You can use following code:

let entityId = (<any>context.mode).contextInfo.entityId;
let entityTypeName = (<any>context.mode).contextInfo.entityTypeName;

View solution in original post

2 REPLIES 2
a33ik
MVP

Hello,

You can use following code:

let entityId = (<any>context.mode).contextInfo.entityId;
let entityTypeName = (<any>context.mode).contextInfo.entityTypeName;

View solution in original post

Hi @a33ik 

This was exactly what I was after. Much appreciated.

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Follow me on Twitter at @QG_LeeJHarris

Or on LinkedIn at in/leejharris

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,216)