Are you using OOB forms or custom forms for leads? OOB forms ("Sales Professional" form for example) trigger a JS-function called ShowContactCardOnForm (as can be seen in the log you provided) on the OnChange event on the field "Existing contact?" (parentcontactid).
This function is implemented in the msdynce_Common.js library. It's purpose is to set the visibility of a section called Summary_section_ContactQuickView (that section contains the parentcontactid and parentaccountid fields) to true or false depending wether parentcontactid contains a value or not (though this section only exists in opportunity forms, but not in lead forms). However, this function checks, wether some JS-objects (such as Xrm, Xrm.Page or the control for the section mentioned above) are defined or not. If not, the following function is called:
It seems, that in some cases the object SalesProAppsTelemetryUtility is defined and in some cases not (I think the true bug lies in the loading order between the library that contains the SalesProAppsTelemetryUtility-object and the msdynce_Common.js library). In the latter case, the error you are talking about is thrown. We had the same issue, which occured only some times.
Possible solution is to remove the ShowContactCardOnForm-handler from the OnChange-event of the parentcontactid field. If you still need a logic to set the visibility of the mentioned section (and/or other sections/fields), you could implement your own JS-function.
We recently started seeing the same error when displaying a lead record in Dynamics 365 Sales. Here's the log:
ReferenceError: SalesProAppsTelemetryUtility is not defined
at ShowContactCardOnForm (https://salesprocrm.crm4.dynamics.com/%7b638540863240000188%7d/webresources/SalesPro/Common/msdynce_Common.js:662:30)
at b._executeFunctionInternal (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:1267461)
at b.execute (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:1265895)
at https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:4:120182
at i (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:113818)
at ne._executeIndividualEvent (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:4:120156)
at ne._executeEventHandler (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:4:116974)
at Object.execute (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:4:114027)
at w._executeSyncAction (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:640531)
at w._executeSync (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:640258)
Error Details:
Event Name: onload
Function Name: ShowContactCardOnForm
I wonder if this is related to the change in the lead interface that Microsoft made? Instead of showing an overview of all leads, it now directly opens a lead record, which seems to have broken something. Would appreciate an explanation suitable for dummies. ;)
ReferenceError: SalesProAppsTelemetryUtility is not defined
at ShowContactCardOnForm (https://brandfinance.crm11.dynamics.com/%7b638537276800000170%7d/webresources/SalesPro/Common/msdynce_Common.js:662:30)
at b._executeFunctionInternal (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:1267461)
at b.execute (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:1265895)
at https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:4:120182
at i (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:113818)
at ne._executeIndividualEvent (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:4:120156)
at ne._executeEventHandler (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:4:116974)
at Object.execute (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:4:114027)
at w._executeSyncAction (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:640531)
at w._executeSync (https://content.powerapps.com/resource/uci-infra-bus/scripts/app.f0499f6f182163ebe02f78abdde2f31a.js:14:640258)
Error Details:
Event Name: onload
Function Name: ShowContactCardOnForm
"
Could you download the log file and provide the log?
Is the ShowConactRecordOnForm function a custom JavaScript?
The JavaScript is added to the onload event on the lead form.
If it is a custom JavaScript, could you provide the complete script code?
According to the error message, it seems that SalesProAppsTelemetryUtility is used without definition.
Best Regards, Dengliang Li
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.