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?
First Error was:
I tested my component and it looks like they are a problem with the getNamedReference().
Using this code:
So the etn properties returns an undefined value.
Unfortunately, I did not.
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
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
this is the same code inside a chrome debug window
and here is confirmation that the current library that .etn is undefined in the current Western Europe (CRM4) region
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
and in copy format
var entityReference=<any>currentRecord.getNamedReference();
let entityFormOptions={
entityName: entityReference.etn || entityReference.LogicalName,
entityId:entityReference.id
};
with confirmation here
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.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.