The Zurich release has arrived! Interested in new features and functionalities? Click here for more

"There is javascript error in your browser console" - Error message appears in service portal form

BhagyasriCh
Kilo Contributor

Hi,

 

While submitting a new record in service portal , the error message is displaying "There is javascript error in your browser console"

Attached screenshots for your reference.

 

Please assist ASAP.

4 REPLIES 4

RaghavSh
Kilo Patron

There is an issue with some client script running on the form.

share the code of that client script, it should have some issue.

 

Sometime if script include return empty value to client script, this error appears, but reasons could be others as well.

 

Also you can put your client script code in try and catch block, it will not show the error but code need to be checked to fix this.

 


Please mark the answer correct/helpful accordingly.

 

 


Raghav
MVP 2023
LinkedIn

Hi Raghav,

 

Thanks for your reply,

We have checked all the catalog client scripts and client scripts but we haven't find any scripts regarding the reference error, attached the same.

Is there any alternate way to check the exact script that we can check.

 

Thanks,

@BhagyasriCh Errors are not always exact, its either a client script or UI Policy run script.

 

Have seen this issue multiple times, so easy way to troubleshoot is deactivate all client script/ ui policies and then reload the form and see if issue still exists.

 

Also see if you are using any custom variable to call ui page/ macro or widget


Raghav
MVP 2023
LinkedIn

aruncr0122
Kilo Guru

Hi @BhagyasriCh ,

 

The error message "There is a JavaScript error in your browser console" and the attached console logs indicate a ReferenceError: embeddedWidgetOptions is not defined. This suggests that the JavaScript code is trying to access a variable or object (embeddedWidgetOptions) that hasn't been defined or initialized, likely within a client script or widget on the service portal.
From the logs, the issue occurs during the execution of a client script (g_validation_script_field_count), and the error is triggered at a point where embeddedWidgetOptions is expected but missing. This could be due to:

A missing or incorrect initialization of the embeddedWidgetOptions object in the script.
A dependency or variable not being loaded properly before the script runs.
An issue with the widget or catalog item configuration on the service portal.

To resolve this:

Check the client script associated with the "Carrier Request" form or widget for any references to embeddedWidgetOptions.
Ensure that embeddedWidgetOptions is properly defined and initialized before it is used (e.g., as a global variable or passed to the script).
Verify that all required scripts and dependencies are included and loaded correctly in the service portal.
Inspect the widget or catalog item (sc_catalog_item_kp.js:515:32) mentioned in the stack trace to ensure it aligns with the form's configuration.