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

OOB Show chart not working :PCF

Hello All,

I have created a custom control and apply that control to the new system opportunity view but what it noticed is OOB show chart is not working.

 

board.png

 

When I debug I found below error from developer tools.

Capture.PNG

 

I am fetching the link entity data (BPF Entity )from the custom control like below.

 this.contextObj.utils
            .getEntityMetadata(
                this.contextObj.parameters.sampleDataSet.getTargetEntityType()
            )
            .then(r => {
                this.contextObj.utils
                    .getEntityMetadata(this._dropdownvalue)
                    .then(b => {
                        this._bpfLinkingAttributeName = b.IsCustomEntity
                            ? `bpf_${r.PrimaryIdAttribute}`
                            : r.PrimaryIdAttribute;
                        this.contextObj.parameters.sampleDataSet.linking.addLinkedEntity({
                            name: uniquename,
                            from: this._bpfLinkingAttributeName,
                            to: r.PrimaryIdAttribute,
                            linkType: "inner",
                            alias: "bpfentity"
                        });
                        if (this.contextObj.parameters.sampleDataSet.addColumn) {
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "activestageid",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "processid",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "createdby",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "traversedpath",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "businessprocessflowinstanceid",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "statuscode",
                                "bpfentity"
                            );
                        }
                    })
                    .then(() => {       
                     
                        const conditionArray: any = [];
                        var condition = {
                            attributeName: "statuscode",
                            conditionOperator: 1, // NotEqual
                            value: 3,
                            entityAliasName: this._dropdownvalue,
                        };
                        conditionArray.push(condition);
                        this.contextObj.parameters.sampleDataSet.filtering.setFilter({
                            conditions: conditionArray,
                            filterOperator: 0, // And
                        });
                        this.contextObj.parameters.sampleDataSet.refresh();
                    });

            });
 
Can anyone please let me know what I am doing wrong here ?

 

1 ACCEPTED SOLUTION

Accepted Solutions

When you add a filter the DataSet changes to the Quickfind view (as it does elsewhere in CE).

 

https://powerusers.microsoft.com/t5/Power-Apps-Component-Framework/Reading-filters-setting-filters-a... has a fully discussion about it and how to handle it - note that Scott Durow is the person asking the original questions - Datasets are complex with a lot of gotchas that will surprise you.

---
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".

View solution in original post

4 REPLIES 4
a-ovbord
Community Support
Community Support

Hi @Bhuvita,

 

I believe you are trying to customize one of the views from the Opportunity entity inside a Dynamics 365 CRM organization with UCI.

If my assumption is correct, then the right place to check this would be on the Dynamics forum: https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum or to open a service request through the Power Platform Admin Center: https://admin.powerplatform.microsoft.com/support

 

Thank you,

Ovidiu

@a-ovbord 

Below is my opportunity view filter criteria :

 
 

I am trying to fetch the BPF entity (opportunitysalesprocess or any BPF entity) data related to the opportunity entity and put filter on that related entity data through my PCF control and use this data to build the PCF control.

 

   this.contextObj.parameters.sampleDataSet.linking.addLinkedEntity({
                            name: uniquename,  //it will be BPF entity name
                            from: this._bpfLinkingAttributeName,  //this will be linking attribute
                            to: r.PrimaryIdAttribute,
                            linkType: "inner",
                            alias: "bpfentity"
                        });

 

if (this.contextObj.parameters.sampleDataSet.addColumn) {
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "activestageid",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "processid",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "createdby",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "traversedpath",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "businessprocessflowinstanceid",
                                "bpfentity"
                            );
                            this.contextObj.parameters.sampleDataSet.addColumn(
                                "statuscode",
                                "bpfentity"
                            );
                        }

                       var condition = {
                            attributeName: "statuscode",
                            conditionOperator: 1, // NotEqual
                            value: 3,
                            entityAliasName: bpfentity,
                        };
                        conditionArray.push(condition);
                        this.contextObj.parameters.sampleDataSet.filtering.setFilter({
                            conditions: conditionArray,
                            filterOperator: 0, // And
                        });
                        this.contextObj.parameters.sampleDataSet.refresh();
                    });

 

So the issue if we put filter on the related entity data the chart does not work.If i remove the filter the chart works.

 

@a-ovbord 

Below is my opportunity view filter criteria.

image.png

 

So when i try to fetch the BPF entity data from my PCF control (code pasted in initial post) and add the link entity data columns in existing context and use this data to build my control.

 

But if i give filter criteria like below on related BPF entity the chart is not working. 

const conditionArray: any = [];
                        var condition = {
                            attributeName: "statuscode",
                            conditionOperator: 1, // NotEqual
                            value: 3,
                            entityAliasName: bpfentity,
                        };
                        conditionArray.push(condition);
                        this.contextObj.parameters.sampleDataSet.filtering.setFilter({
                            conditions: conditionArray,
                            filterOperator: 0, // And
                        });
                        this.contextObj.parameters.sampleDataSet.refresh();
                    });

If i remove this criteria then chart again works.

 

When you add a filter the DataSet changes to the Quickfind view (as it does elsewhere in CE).

 

https://powerusers.microsoft.com/t5/Power-Apps-Component-Framework/Reading-filters-setting-filters-a... has a fully discussion about it and how to handle it - note that Scott Durow is the person asking the original questions - Datasets are complex with a lot of gotchas that will surprise you.

---
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
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,163)