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
Microsoft
Microsoft

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

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

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

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Users online (51,049)