Catalog client script for making a variable bold is working on DEV but not on PROD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 03:12 AM - edited 07-10-2025 03:13 AM
function onLoad(){
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 03:41 AM
may be the timeout is less for PROD
In PROD the page is taking time to load
Try increasing the timeout to 5 seconds and migrate the update set and then check
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 08:26 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 09:51 PM
DOM Access Differences
- The script uses document.getElementsByClassName("ng-binding"), which is DOM-dependent.
- If the portal theme or layout differs between DEV and PROD, the class names or structure might not match.
- Try inspecting the portal in PROD using browser dev tools to confirm if "ng-binding" is present.
Script Load Timing
- You're using setTimeout with 1000ms. If the DOM isn't fully loaded by then in PROD, it might fail.
- Try increasing the timeout to 2000ms or use a more reliable method like window.onload or MutationObserver.
Browser Console Errors
- Check the browser console in PROD for any JavaScript errors that might be blocking execution.
✔️ If this solves your issue, please mark it as Correct.
✔️ If you found it helpful, please mark it as Helpful.
—
Shubham Jain
