cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Not able to access the relational table using the ModelDrivenFormIntegration for the Lookup type

Any help would be appreciated here.

I am trying to get the Field value of the Lookup type Entity (Customer Assets) through the ModelDrivenFormIntegration (Work Order) in a Canvas App.

 

Below is the formula that I am applying

LookUp(
       'Customer Assets',
       'Customer Asset'=[@ModelDrivenFormIntegration].Item.'Primary Incident Customer Asset'.'Customer Asset'
).Name

 

"[@ModelDrivenFormIntegration].Item" refers to the Work order table.

 

I am able to see the Customer Asset's name in Canvas app.

However, when i Saved and Published it, not able to get the same value in the D365 Field Service.

We have already tried solution such as adding timer and updateContext but nothing seems to be working.

3 REPLIES 3
rampprakash
Super User
Super User

Hello @Anonymous,

 

Did you PATCH the Update to the System

 

Set(customerAseetName,LookUp(
       'Customer Assets',
       'Customer Asset'=[@ModelDrivenFormIntegration].Item.'Primary Incident Customer Asset'.'Customer Asset'
).Name);

Patch(TableName,{TableUniqueID: GUID/USE LOOKUP},{customerAseetFieldName,customerAseetName})

 

For update you can use https://debajmecrm.com/using-patch-function-in-canvas-app-to-update-a-cds-record-based-on-value-of-non-primary-key-field/  for your reference

 

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

 

 

Anonymous
Not applicable

Hi @rampprakash ,

I tried your solution and added this formula on Screen's OnVisible Property

 

 

Set(customerAssetName ,LookUp(
       'Customer Assets',
       'Customer Asset'=[@ModelDrivenFormIntegration].Item.'Primary Incident Customer Asset'.'Customer Asset'
));

Set(nameOfAsset, Patch('Work Orders', { 'Work Order Number': ModelDrivenFormIntegration.Item.'Work Order Number'}, {'Customer Asset': customerAssetName}))

 

 

and added this in Text property of Text Component 

 

nameOfAsset.'Customer Asset'.Name

 

and it didn't work. also, it started giving me this error in the D365 work order where I have embedded my canvas app.

Screenshot 2022-01-11 at 6.25.22 PM.png

Hello @Anonymous ,

 

As per the error it is expecting mandatory field called msdyn_name

 

So try passing that value also in PATCH

 

 

Set(customerAssetName ,LookUp(

       'Customer Assets',

       'Customer Asset'=[@ModelDrivenFormIntegration].Item.'Primary Incident Customer Asset'.'Customer Asset'

));

 

Set(nameOfAsset, Patch('Work Orders', { 'Work Order Number': ModelDrivenFormIntegration.Item.'Work Order Number'}, {msdyn_name:nameofworkorder,'Customer Asset': customerAssetName}))

 

Please mark as Answer if it is helpful and provide Kudos

 

 

Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

Blog : https://microsoftcrmtechie.blogspot.com

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,303)