cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

EntityReference type definition

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.

 

 

 

2 REPLIES 2
Highlighted
Community Support
Community Support

Hi @eleung83 ,

 

Please try to raise a support ticket here:

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

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Solution Sage
Solution Sage

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-Samp... 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.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (10,496)