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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / EntityReference type d...
Power Apps
Unanswered

EntityReference type definition

(0) ShareShare
ReportReport
Posted on by 232

When using EntityRecord.getNamedReference(), as per the docs I should receive an object of type EntityReference. When I view the type definition for this type it currently contains the following properties:

 

1. id -> object with guid property

2. etn -> optional

3. name

 

When I debug my pcf control and place breakpoints on the ts file in Chrome where this method is called I am getting the attached object returned, which does not contain and "etn" property.

 

This both does not match with the Type definition, and, as there is no "etn" property of this object, this means that I am not able to get the entity logical name from the reference. I have to edit the type definition and then add a couple extra optional properties to this type:

 

1. entityName

2. logicalName

 

On top of this, ComponentFramework.Context.navigation.openForm takes an EntityFormOptions object which contains a property: createFromEntity, of type EntityReference. If I follow the current type definition for this object type, I cannot use openForm to open a create entity form as the Id parameter is incorrect for the "createFromEntity". From the documentation the properties for the "createFromEntity" EntityReference should be a flat set of strings, but the type definition for the id property indicates an object with a property.

 

 

 

JS.PNG
I have the same question (0)
  • v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @eleung83 ,

     

    Please try to raise a support ticket here:

    https://powerapps.microsoft.com/en-us/support/pro/ticket/

     

    Regards,

    Mona

  • Ben Thompson Profile Picture
    1,400 on at

    Sorry hadn't noticed this before

     

    The issue is identical to the problem you see in https://powerusers.microsoft.com/t5/Power-Apps-Component-Framework/Table-Grid-Dataset-Component-Sample/m-p/397886#M1174 where etn is just not being returned.

     

    As I commented there try using the following

     

    var entityReference=<any>currentRecord.getNamedReference();
    let entityFormOptions={
     entityName: entityReference.etn || entityReference.LogicalName,
     entityId:entityReference.id
    };

      which gets the Logical name if the etn isn't set.

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 Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard