cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

CDS Opportunity Can't Access Price list Field.

I am trying to access the Price List field from an opportunity using a Model Driven Form app. I am attempting to access it like this.

 

Filter('Price Lists', 'Price List' = GUID(First([@ModelDrivenFormIntegration].Data).ItemId)).'Price List'

 

In accordance with what I read here. 

 

https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/embedded-canvas-app-guidelines

 

However it doesn't seem that the @ModelDrivenFormIntegration contains the Price List data even though one is specified on the record. Anybody know where I am going wrong?

 

Regards

 

Jon

1 ACCEPTED SOLUTION

Accepted Solutions

Hi

 

In the end I found I was running up against limitations that the unique functionality I wanted required. Primarily the limitation I reached resulted in the "Multiple levels of expansion aren't supported." error. 

 

So I tried a different approach and created a custom entity to hold the information I needed. Created a function app to update the information on a schedule and with in a couple of hours my Power App was working correctly. 

 

Thank you all for you suggestions. 

View solution in original post

27 REPLIES 27
Super User II
Super User II

Hi,

Do not use ModelDrivenFormIntegration.Data. Instead use ModelDrivenFormIntegration.Item

Is your app embedded in the Price List entity main form?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

Hi @PowerAddict 

 

I have tried ModelDrivenFormIntegration.Item also and that doesn't work either.

 

The app is embedded in the Opportunity entity.

 

Regards

 

Jon

 

And apologies for my lack of knowledge of the data here. But are Price Lists linked to Opportunities?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

Price List is a lookup field on opportunity. 

Ok and one last question which connector are you using? D365 or CDS?

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

CDS

Ok, so relational data in an embedded canvas app has always been an issue (posted by me on one of my blogs: https://medium.com/hitachisolutions-braintrust/overcoming-top-5-challenges-with-embedded-canvas-apps...

 

Anyway, this is how I made it work. 

 

I have 2 screens in my app: 

2. Screen 2: has a gallery of Opportunities (Gallery1) with the Items property set to 

Filter(Opportunities, Opportunity = [@ModelDrivenFormIntegration].Item.Opportunity)

and (optional) I also have a label within the gallery that displays ThisItem.'Price List'.Name 

 

1. Screen 1: has a gallery of Price Lists (Gallery2) with the Items property set to 

Filter('Price Lists', 'Price List' = First(Gallery1.AllItems).'Price List'.'Price List')

 

Let me know if this works. 

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

Unfortunately your example doesn't help. 

 

I am calling this from an Opportunity and so that context is what is sent to the app. My issue is that 

 

[@ModelDrivenFormIntegration].Item.'Price List' doesn't seem to contain any data even though that field is populated on the calling opportunity.

 

 

I am also calling it from within an opportunity which is why in Gallery1, I am using the ModelDrivenFormIntegration to fetch the opportunity record. 

 

The opportunity record using the ModelDrivenFormIntegration doesnt download related data. So you have to use lookup to fetch the complete Opportunity record first using the ModelDrivenFormIntegration.Item.Opportunity. 

 

You can then use that completely fetched record to get your price lists. 

 

Let me know if this isnt clear and I will try to share screen by screen document.

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (1,898)