WHEN SUBMITTING A CATALOG ITEM IN NATIVE UI VIEW GETTING AN ERROR ON SUBMIT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi All,
When a user is trying to submit an request for catalog item it is throwing an error on submit (attached error)
Also attached the browser console error message and the on submit client script configured.There is only one on submit client script configured for this catalog item.
Please let us know what changes to be done .
Thank you .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
your onSubmit is causing the issue
it's using DOM manipulation. If you want to use DOM manipulation then Isolate Script field should be false
what's the acceptPolicy check requirement?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
you see the Isolate Script field is True for that and hence it's causing error
but what's the requirement there?
there could be better way to achieve the requirement without DOM as well
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Can you confirm whether acceptPolicy is a variable of Multi row variable set or any other variable set.
Because in your onSubmit code , saw "parent.document".
Did you check whether you can avoid DOM manipulation as KB0954537 Client-side code should not use DOM manipulation techniques
If acceptPolicy is variable of MRVS , you can use following
function onSubmit() { var isAccepted = g_form.getValue('accept_policy');
var isParentAccepted = parent.g_form.getValue('accept_policy');
if (isAccepted !== 'true' && isAccepted !== '1' && isAccepted !== true) { alert('Please read and accept the policy'); return false; }
else if (isParentAccepted !== 'true' && isParentAccepted !== '1' && isParentAccepted !== true){
alert('Please read and accept the policy'); return false;
} }
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti