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

UpdateContext does not work on Dynamics New Form for Gallery onSelect

Hi

 

- Embedded Canvas App on Dynamics Quote entity

- Used to add Quote Lines to Quotes

- Gallery of Price List Items displaying available Products with the price for the Product

- On Select of a Price List Item I would like to populate the selected product & price into the Quote Line Form

- The Form is of Type "New"

- On Select of a Gallery item, it UpdatesContext and sets the variables that are used in the Form

 

Now the issue is: sometimes the OnSelect works and fires, sometimes it doesnt.

It works in only about 20% of the cases.

 

OnSelect in Gallery:

 

UpdateContext({pricePerUnit: PriceListItems.Selected.Amount; product: PriceListItems.Selected.Product; unit: PriceListItems.Selected.Unit})
Product_DataCard.DataCardValue.Default = product
Unit_DataCard.DataCardValue.Default = unit
Price_DataCard.DataCardValue.Default = pricePerUnit

 

image.png

Any ideas why the UpdateContext doesnt update my Form?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

I figured out the issue.

It happens when I click on my labels.

All labels have Select(Parent) but it seems this is not called.

Issue was the DisplayMode which was set to "View".

View solution in original post

3 REPLIES 3
Drrickryp
Super User II
Super User II

Hi @Serf 

As a test could you use Set() instead of UpdateContext() and see if that works?

 

Set(pricePerUnit; PriceListItems.Selected.Amount);;
Set(product; PriceListItems.Selected.Product);; 
Set(unit; PriceListItems.Selected.Unit)

 

 

Exact same issue. Feels it works a litte more often, but from 50 click, it works maybe 25 times.

 

 

What is the difference between the default value of the Card vs the default value of the concrete item?

 

I figured out the issue.

It happens when I click on my labels.

All labels have Select(Parent) but it seems this is not called.

Issue was the DisplayMode which was set to "View".

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (46,281)