ServiceNow has effectively prevented its customers from utilizing any form of DOM manipulation in the service portal. For those who were brave enough to invest heavily in the Service Portal early on, this has caused major issues.
Nearly every ServiceNow customer with an even moderately utilized Service Catalog, has some Catalog Client Scripts which make use of things like g_form.getElement(). Here are just a few things we've run into, that we're not able to do in Service Portal without MAJOR custom hacks:
- Use the document object to retrieve URI parameters in order to parse them for a client script
- Adds event listeners to input fields on load in order to monitor for events other than "change" which requires entering the field, modifying some data, then tabbing out of the field again.
- Parse URI parameters to do any kind of auto-population or other processing based on them, by using document.URL.parseQuery() (the solution recommended by ServiceNow).
- Toggle form containers
- Get information from fields in other widgets,
- Redirect pages
- Show/hide/change a variable label, variable set, or container dynamically
Click below, to keep reading and learn how to re-enable all of this functionality in your Catalog Client Scripts on the Service Portal.
Read more