cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SumitThakran
Helper I
Helper I

PCF Control giving error when its added in Form on Dynamics 365 Platform

Hi 

 

I have developed custom PCF Control in Typescript . I have used some React JS code to open React-Modal as popup window in Control Button Click.

This custom PCF Control is running fine when i am running it locally i.e from Visual Studio code. But when i deployed PCF Control to my Dynamics 365 environment.

And tried to access control in CRM Form then getting below error show in screenshot.

 

SumitThakran_0-1592824471412.png

 

Basically i have used React js inside my Typescript project. I have used React-Modal component for showing popup window .

i did some analysis and found that when i remove Modal tsx file from my PCF Control and deployed simple component on Dynamics 365 platform then this error is not coming .

 

Can anyone tell me what i am doing wrong while calling Modal component or in its contructor.

So below is my piece of code i wrote it down to call my Modal component. Basically passing one parameter to Modal Component.

<MyModal inputABN = {this.state.inputValue}/>

 

And below is constructor of My Modal component.

export class MyModal extends React.Component<ModalProps, any> {
constructor (props: ModalProps) {
super(props);
this.state = {
showModal: false , inputABN: props.inputABN
};
............................

 

Any help will be appreciated .

 

Thanks

11 REPLIES 11

Hi Scott,

 

Thanks for your comment.

 

Ya i will try to set it to id of div in PCF component.

 

Thanks

tayurskiy
New Member

I am getting exact same error for my PCF control. I do not use React but I am calling Google API address autocomplete in the control. The control works most of the time with no issues in CRM. The error is thrown when I navigate from account where the control lives to a related case and then on the case I click on "Customer" lookup field to navigate back to the account. This is the only time I get "Error loading control" on the account form. Clicking on that link gives me error below. Once again, the control works if I navigate to accounts directly.

Error occured during initialization of control: rsm_RSM.AddressAutocomplete;Message: Could not find/invoke RSM.AddressAutocomplete's constructor

Here is more details I get from the debugger:

Error: Could not find/invoke RSM.AddressAutocomplete's constructor at t._createControlInstance (https://mbaslldev.crm9.dynamics.com/uclient/scripts/7.js?v=1.4.2807-2105.5:1:219874) at https://mbaslldev.crm9.dynamics.com/uclient/scripts/7.js?v=1.4.2807-2105.5:1:220360 at t._measureLifecycleMethod (https://mbaslldev.crm9.dynamics.com/uclient/scripts/7.js?v=1.4.2807-2105.5:1:219396) at t._initializeControl (https://mbaslldev.crm9.dynamics.com/uclient/scripts/7.js?v=1.4.2807-2105.5:1:220282) at https://mbaslldev.crm9.dynamics.com/uclient/scripts/7.js?v=1.4.2807-2105.5:1:209191 at e.w [as _scheduleControlUpdate] (https://mbaslldev.crm9.dynamics.com/uclient/scripts/app.js?v=1.4.2807-2105.5:3706:389) at e.scheduleControlUpdate (https://mbaslldev.crm9.dynamics.com/uclient/scripts/app.js?v=1.4.2807-2105.5:647:2214) at n (https://mbaslldev.crm9.dynamics.com/uclient/scripts/7.js?v=1.4.2807-2105.5:1:209111) at t._initializeData (https://mbaslldev.crm9.dynamics.com/uclient/scripts/7.js?v=1.4.2807-2105.5:1:209230) at t.componentDidMount (https://mbaslldev.crm9.dynamics.com/uclient/scripts/7.js?v=1.4.2807-2105.5:1:234827) at ws (https://mbaslldev.crm9.dynamics.com/uclient/scripts/app.js?v=1.4.2807-2105.5:3788:94541) at t.unstable_runWithPriority (https://mbaslldev.crm9.dynamics.com/uclient/scripts/app.js?v=1.4.2807-2105.5:4031:3884) at ha (https://mbaslldev.crm9.dynamics.com/uclient/scripts/app.js?v=1.4.2807-2105.5:3788:41486) at Is (https://mbaslldev.crm9.dynamics.com/uclient/scripts/app.js?v=1.4.2807-2105.5:3788:90551) at gs (https://mbaslldev.crm9.dynamics.com/uclient/scripts/app.js?v=1.4.2807-2105.5:3788:79290) at https://mbaslldev.crm9.dynamics.com/uclient/scripts/app.js?v=1.4.2807-2105.5:3788:41758

Helpful resources

Announcements
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 (2,429)