Hi Power Apps Community,
My issue is that I could not get the value of Work Order Id or name of WorkOrder Entity entity in my canvas app.
I created a New tab in WorkOrder View Form and embedded a new canvas app in it. I used this tutorial https://aaronkgumbs.com/2021/07/24/how-to-enable-modeldrivenformintegration-for-existing-canvas-apps....
After using above url, We can get ModelDrivenFormIntegration Entity in canvas app.
I am using a PCF component in canvas app and I have to send WorkOrder ID in PCF component property like this.
According to this MS Documentation https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/embedded-canvas-app-add-classic-d... We can get any record of the table using ModelDrivenFormIntegration.Item.accountnumber. In my case I have to use msdynworkorderid. But I am not able to get the correct record of data.every time it is giving null value.
After doing some research, it seams as the ModelDrivenFormIntegration control has not been initialised yet when app loads.
So i check this blog which shows 2 possible solutions https://carinaclaesson.com/2020/05/30/exploring-the-modeldrivenformintegration-control-in-embedded-c...
Add a timer or set the formula on the RefreshData property of the ModelDrivenFormIntegration control.
Both solutions doesn't work and Used formulas are also giving Errors.
Looking forward to your solution / advice.
Many thanks,
Dhruvil
Solved! Go to Solution.
Hi @Anonymous ,
Are you suggesting that you are not getting the value of a column of a related table? If so, suggest looking up the contextual record first and then using it to fetch the related table's column value(s).
On the app OnStart, I always do this:
Set(gblRecord, LookUp(Table, GUID = ModelDrivenFormIntegration.Item.GUID))
Then get the related table's value like this:
Set(gblRelatedTableValue, gblRecord.RelatedTable.Column)
Here is a blog I have on everything related to embedded canvas apps: https://thepoweraddict.com/everything-you-need-to-know-about-embedded-canvas-apps/ (Post #3).
Let me know if this helps.
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
Hi @Anonymous ,
Are you suggesting that you are not getting the value of a column of a related table? If so, suggest looking up the contextual record first and then using it to fetch the related table's column value(s).
On the app OnStart, I always do this:
Set(gblRecord, LookUp(Table, GUID = ModelDrivenFormIntegration.Item.GUID))
Then get the related table's value like this:
Set(gblRelatedTableValue, gblRecord.RelatedTable.Column)
Here is a blog I have on everything related to embedded canvas apps: https://thepoweraddict.com/everything-you-need-to-know-about-embedded-canvas-apps/ (Post #3).
Let me know if this helps.
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
Hi @PowerAddict
Thanks for your suggestion.
I don't want to get data from related tables. I need to retrieve the data of current work order data in which I have added my canvas app.
In simple way, I only want to show the Work Order display name in my Canvas app.
Instead of ```abcd``` I need to print WorkOrder Name(Text) which is ```00507```
EDIT: I also tried formulas suggested by you but they started giving me formula errors.
Thanks!
That should just be this:
LookUp('Work Orders', 'Work Order' = [@ModelDrivenFormIntegration].Item.'Work Order').'Work Order Number'
Replace 'Work Order Number' with the column name for work order number. Let me know if this doesn't work.
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
I tried your formula but it started giving these errors in the formula itself.
The function 'LookUp' has some invalid arguments.
Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.
Well, I assumed column names. You need to replace 'Work Order' with whatever the name is of the GUID column on the Work Orders table and replace 'Work Order Number' with whatever the name is of the work order number column. Let me know if this helps.
---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions.
Thanks!
Hardit Bhatia
Microsoft Business Applications MVP
Microsoft Certified Trainer MCT
I am also facing the same problem
I tried this solution by replacing 'Work Order' with msdyn_workorder. I checked this form here.
But the result is the same. For reference, I am adding the Canvas app here.
I tried this solution by replacing 'Work Order' with msdyn_workorder. I checked this from here https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/msdyn_workorder?view=dynami... .
But the result is same. For reference I am adding Canvas app here.
I tried @PowerAddict 's suggested blog and compared the canvas app with my canvas app and I managed to make it work by adding a Work Order Table in Canvas app.
Now i can get current work order record in the canvas app using this formula
ModelDrivenFormIntegration.Item.'Work Order Number'
Thanks @PowerAddict,
It was very useful blog https://thepoweraddict.com/everything-you-need-to-know-about-embedded-canvas-apps/.
User | Count |
---|---|
157 | |
86 | |
68 | |
63 | |
61 |
User | Count |
---|---|
211 | |
152 | |
93 | |
81 | |
70 |