Cloned the OOB EC Request Content widget and getting the console error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I have cloned the OOB EC Request Content widget. I also cloned the widgets that are being called by it, including EC Request Tabs and EC Requests.
I have not made any logic changes to the cloned widgets. They render correctly when the OOB widget is used on the same page.
However, when I use my custom & cloned EC Request Content widget on the page, it is working fine but if i use only custom widget, I get the following browser console error:
"There is a JavaScript error in your browser console."
Thanks & Regards,
Srinithi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Since the OOB EC Request Content widget works and the cloned version only throws the error when used by itself, I would first compare the cloned widget against the OOB widget for any missing dependencies rather than focusing on the widget logic.
A few things to check:
- Verify that all widget dependencies, Angular providers, CSS/JS includes, and embedded widgets referenced by EC Request Content were cloned correctly.
- Compare any $sp.getWidget() or spUtil.get() calls to ensure the cloned widget is not still referencing an OOB widget/sys_id.
- If the cloned widget is in a different application scope, check Restricted Caller Access records and cross-scope privileges. Employee Center widgets often rely on script includes and resources that are caller-restricted.
- Compare the widget instance options/configuration between the OOB and cloned versions.
The fact that the custom widget works when the OOB widget is also present suggests that the OOB widget is likely loading or initializing a dependency that the cloned widget expects, but which is not available when the OOB widget is removed.
Can you share the actual browser console error/stack trace (the red error shown above "There is a JavaScript error in your browser console")? That will help identify the exact missing dependency or failing script.
Thanks and Regards,
Alok
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
When you clone widgets that embed other widgets in itself, you will need to update the parts that are calling the widgets to call the new widgets which would be the HTML, Server Script, or Client Controller usually.
- EC Requests (ec-requests) calls for EC Request Tabs (ec-requests-tabs) which is specified in the Server Script.
- EC Request Tabs (ec-requests-tabs) calls for EC Request Content (ec-request-content) which is also specified in the Server Script
