Hi,
i'm trying to build a PCF for data grid, when i click on specific record of row at local environment it gives me this error alert
Your control is trying to open a form. This is not yet supported
and after deploying to Model driven app it neither open the record nor shows any error.
here is my click event code in index.ts
Thanks in advance.
Solved! Go to Solution.
Hi @HemantG @a33ik and @v-xida-msft
Thank you so much for your help and precious time.
i was just tried to open the entity form by clicking on the Record Row at the Entity grid view.
I have fixed the issue by updating the EntityReference interface in the
"node_modules\@types\powerapps-component-framework\componentframework.d.ts"
earlier my code was looked like this
interface EntityReference {
/**
* The record id. Read-only.
*/
id: { guid: string; };
/**
* The entity logical name. Read-only.
*/
etn?: string;
/**
* The name of the entity reference. Read-only.
*/
name: string;
}
I have updated it
Hi @MBilal-079 ,
Do you want to launch a dialog to open your specific Entity Form?
The context.navigation.openForm(options [, parameters]) function is used to open a entity form or a quick create form, so please make sure you have specified a proper value for the formId attribute within the EntityFormOptions argument in your context.navigation.openForm(options [, parameters]) function.
In addition, the attributes mentioned within the EntityFormOptions are all Required attribute, so you must provide a proper value each one of them (except "useQuickCreateForm" attribute.)
Please consider modify the function in your index.ts file as below:
let rowRecordId = (event.currentTarget as HTMLTableRowElement).getAttribute(RowRecordId);
if (rowRecordId) {
let entityReference = this.contextObj.parameters.simpleTableGrid.records[rowRecordId].getNamedReference();
let entityFormOptions = {
createFromEntity: {
entityType: "xxx",
id: "xxxx",
name: "xxxx"
},
entityName: entityReference.etn!,
entityId: entityReference.id.guid,
formId: "Type specific form Id which you want to display here", // modify formula here
height: 580,
width: 400,
windowPosition: 1,
openInNewWindow: false
}
this.contextObj.navigation.openForm(entityFormOptions);
}
The Form Id of the specific Entity form as below:
Please consider take a try with above solution, check if the issue is solved.
Best regards,
Hello,
Have you enabled Utility in ControlManifest file? If not it will look like following:
<feature-usage>
<uses-feature name="Utility" required="true" />
</feature-usage>
Please check the PCF sample for openForm and compare the runtime parameters and formats - here.
Internally it uses the ClientAPI for openForm here .
Code snippet below for ClientAPI shows the parameters
var entityFormOptions = {};
entityFormOptions["entityName"] = "contact";
// Set default values for the Contact form
var formParameters = {};
formParameters["firstname"] = "Sample";
formParameters["lastname"] = "Contact";
formParameters["fullname"] = "Sample Contact";
formParameters["emailaddress1"] = "contact@adventure-works.com";
formParameters["jobtitle"] = "Sr. Marketing Manager";
formParameters["donotemail"] = "1";
formParameters["description"] = "Default values for this record were set programmatically.";
// Open the form.
Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
function (success) {
console.log(success);
},
function (error) {
console.log(error);
});
You can check and compare the values for working and non working code in the browser debug console. I suspect that the format might be different.
Hemant
Hi @HemantG @a33ik and @v-xida-msft
Thank you so much for your help and precious time.
i was just tried to open the entity form by clicking on the Record Row at the Entity grid view.
I have fixed the issue by updating the EntityReference interface in the
"node_modules\@types\powerapps-component-framework\componentframework.d.ts"
earlier my code was looked like this
interface EntityReference {
/**
* The record id. Read-only.
*/
id: { guid: string; };
/**
* The entity logical name. Read-only.
*/
etn?: string;
/**
* The name of the entity reference. Read-only.
*/
name: string;
}
I have updated it
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.
User | Count |
---|---|
10 | |
8 | |
5 | |
3 | |
2 |