cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Helper III
Helper III

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
Highlighted
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)
Highlighted
Helper III
Helper III

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

 

Highlighted
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)
Highlighted
Helper III
Helper III

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

Price List is a lookup field on opportunity. 

Highlighted
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)
Highlighted
Helper III
Helper III

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

CDS

Highlighted
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)

Highlighted
Helper III
Helper III

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.

 

 

Highlighted
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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,198)