cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jonfarmer4999
Level: Powered On

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
Jonfarmer4999
Level: Powered On

Re: CDS Opportunity Can't Access Price list Field.

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
Super User

Re: CDS Opportunity Can't Access Price list Field.

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)
Jonfarmer4999
Level: Powered On

Re: CDS Opportunity Can't Access Price list Field.

Hi @PowerAddict 

 

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

 

The app is embedded in the Opportunity entity.

 

Regards

 

Jon

 

Super User
Super User

Re: CDS Opportunity Can't Access Price list Field.

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)
Jonfarmer4999
Level: Powered On

Re: CDS Opportunity Can't Access Price list Field.

Price List is a lookup field on opportunity. 

Super User
Super User

Re: CDS Opportunity Can't Access Price list Field.

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)
Jonfarmer4999
Level: Powered On

Re: CDS Opportunity Can't Access Price list Field.

CDS

Super User
Super User

Re: CDS Opportunity Can't Access Price list Field.

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)

Jonfarmer4999
Level: Powered On

Re: CDS Opportunity Can't Access Price list Field.

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.

 

 

Super User
Super User

Re: CDS Opportunity Can't Access Price list Field.

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,096)