cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
John742
Frequent Visitor

Table Grid Dataset Component Sample

I am trying to build my first Dataset component. I took th ecode from the Table Grid sample component to get started. That code however is not working. I am getting the following errors. (https://docs.microsoft.com/en-us/powerapps/developer/component-framework/sample-controls/table-grid-...)

 

 

I figured perhaps it was a capitalization error and changed it to below and get more errors. Anyone know what is going on here?

Annotation 2019-11-06 105651.png

9 REPLIES 9
John742
Frequent Visitor

First Error was:

Annotation 2019-11-06 110435.png

Hello,

Can you try with the following in attachment ?

 

 

I tested my component and it looks like they are a problem with the getNamedReference().
Using this code:

                        console.log("CLick on :"+ entityReference.id);
                        let entityFormOptions = {
                            entityName: <string>entityReference.etn,
                            entityId: entityReference.id.toString(),
                            openInNewWindow: true
                        }
                        console.log("Object: "+entityFormOptions);
                        console.log("Object Etn : "+ <string>entityReference.etn);
                        console.log("Object Id: "+ entityReference.id.toString());
                        this._context.navigation.openForm(entityFormOptions);
                        console.log("Open :"+ entityReference.id);



So the etn properties returns an undefined value.

 

image2.png

 

 

 

 

@John742 

Did you find the solution for this ?

 

I am also facing the same issue

John742
Frequent Visitor

Unfortunately, I did not.

HemantG
Power Apps
Power Apps

I downloaded the latest samples and also refreshed the CLI using "PAC install latest" and was  able to build the control and see it in the test harness. 

 

Check the change in the latest code for the sample for the lines you pointed out as error 

 

 let entityFormOptions = { entityName: entityReference.etn!, entityId: entityReference.id.guid, };
 
 
hemant 
 
 
 
 

@HemantG 

I have install the latest CLI.

etn is still not available. Please see the attached screenshot.

 

@Bhuvita Can I jump in and add 3 screenshots instead of 1

 

This is sample typescript code - note no issues reported

code1.png

 

 

this is the same code inside a chrome debug window

 

chrome1.png

 

 

and here is confirmation that the current library that .etn is undefined in the current Western Europe (CRM4) region

chrome2.png

 

It seems that there is an issue somewhere between the typescript library and type definitions and the library being served from within the organisation.

 

Now for the moment you can fix it by using

 

code2.png

 

and in copy format

 

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

 

 

with confirmation here

 

Screenshot_41.png

 

 

But I wouldn't really want to be introducing hacks like this.

 

It's annoying that both Microsoft's document and Microsoft's Typescript Component Framework definitions say one thing while the actual production code says something else.

 

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

@ben-thompson 

yeah right now I am just ignoring the typescript like this.

bug1.PNG

 

 
 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (46,958)