cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alligator_k
New Member

Way to find pcf control update method call because of we click on show chart in Dynamics CRM

Hi,

 

I created sample PCF control for dataset.As I already know that update method call when we click on show chart or click on refresh button from ribbon bar.I want a ways from which it easy to identify update method call because of show chart .

 

So is there any way to identify that.

 

Thanks

 

4 REPLIES 4
ben-thompson Impactful Individual
Impactful Individual

Re: Way to find pcf control update method call because of we click on show chart in Dynamics CRM

No information is sent alongside the trigger so you won't know what triggered it (updateview is called whenever anything changes so it's could just as easily be because the browser window has changed size)

 

I suspect if the user has clicked a graph and changes the view the dataset available to the PCF component will be changed / refreshed (I don't have time to test that process). If that's the case you could keep a track within the PCF of the record count of the initial dataset and the count of the new dataset and a change in record count as your identifier.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Re: Way to find pcf control update method call because of we click on show chart in Dynamics CRM

@ben-thompson is correct. When you click on a chart segment/refresh button/quick find/view selector, the data is simply reloaded and piped to the updateView - you don't get notified of why it has changed - only that it has changed.

 

I do a record count and row by row comparison on the sortedRecordIds to establish if any of the data has been changed.

 

Hope this helps

DianaBirkelbach Advocate V
Advocate V

Re: Way to find pcf control update method call because of we click on show chart in Dynamics CRM

Hi @Alligator_k 

Maybe you can make use of context.updatedProperties that are passed with the updateView method.

This is documented in the sdk, but is not really documented what can be the content of this Array of strings.

I've made a short check, and saw that:

- after change the view selector you get : ["layout"]

- after change the filter: ["dataSetGrid", "parameters"] or ["dataSetGrid", "parameters", "dataset"]

- after refresh button: ["dataSetGrid", "parameters"]

- after open a chart: ["layout", "dataSetGrid", "parameters", "dataset"]

Also there are a lot calls with  empty array passed in between. 

I think is not very safe to rely on this, is depends what you need to do, but maybe it helps.

 

Best regards,

Diana

ben-thompson Impactful Individual
Impactful Individual

Re: Way to find pcf control update method call because of we click on show chart in Dynamics CRM

If it's documented in the SDK then it's the go to solution and I suspect the documentation is lacking because it may not be populated in all circumstances.

 

I suspect a combination of this and checks against the old and new datasets would be the ideal approach.

---
If this post has answered your question please consider it for "Accept as Solution" or if it has been helpful give it a "Thumbs Up".

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Users online (6,068)