not able to trigger catalog client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2025 02:44 PM
No value present: java.util.NoSuchElementException: No value present: java.base/java.util.Optional.get(Optional.java:143)
com.glide.ui.ng.app.AppResources$RecordAcl.ifCanRead(AppResources.java:396)
com.glide.ui.ng.NGUserProcessor.process(NGUserProcessor.java:103)
com.glide.ui.ng.AngularProcessor.process0(AngularProcessor.java:257)
com.glide.ui.ng.AngularProcessor.process(AngularProcessor.java:190)
com.glide.processors.AProcessor.runProcessor(AProcessor.java:759)
com.glide.processors.AProcessor.processTransaction(AProcessor.java:313)
com.glide.processors.ProcessorRegistry.process0(ProcessorRegistry.java:187)
com.glide.processors.ProcessorRegistry.process(ProcessorRegistry.java:175)
com.glide.ui.GlideServletTransaction.process(GlideServletTransaction.java:58)
com.glide.sys.Transaction.run(Transaction.java:2734)
com.glide.ui.HTTPTransaction.run(HTTPTransaction.java:35)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
java.base/java.lang.Thread.run(Thread.java:840)
I'm getting this error while refreshing catalog form in my DEV instance. How to resolve this error? and I have written client script for the catalog item but it's not triggering. Is above error could be reason if yes how to overcome. I have checked in PDI, client script is not causing any error and producing required result.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 05:21 AM
please find the client script below : function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue === '') { g_form.clearOptions('salesforce_profile_required'); g_form.addOption('salesforce_profile_required', ' ', '--None--'); return; } var platform = g_form.getValue('salesforce_platform'); // console.log("platform:", platform); // Debugging if (platform == 'Salesforce - OMC') { g_form.clearOptions('salesforce_profile_required'); g_form.addOption('salesforce_profile_required', ' ', '--None--'); g_form.addOption('salesforce_profile_required', 'executive', 'Executive'); g_form.addOption('salesforce_profile_required', 'omc_gcl', 'OMC_GCL'); // g_form.setValue('salesforce_profile_required', 'executive', 'Executive'); // Set default } else if (platform == 'Salesforce - Flywheel') { g_form.clearOptions('salesforce_profile_required'); g_form.addOption('salesforce_profile_required', ' ', '--None--'); var gr = new GlideRecord('question_choice'); gr.addQuery('question', '1d6b2daf83dc6250a340c8efeeaad39b'); gr.orderBy('order'); gr.query(); if (gr.hasNext()) { while (gr.next()) { g_form.addOption('salesforce_profile_required', gr.value.toString(), gr.text.toString()); } //g_form.addOption('salesforce_profile_required', 'contract', 'Contract'); // g_form.setVisible('contract', true); //g_form.setVisible('omc_gcl', true); // g_form.setVisible('executive', true); //g_form.addOption('salesforce_profile_required', 'executive', 'Executive'); //g_form.addOption('salesforce_profile_required', 'omc_gcl', 'OMC_GCL'); // g_form.setValue('salesforce_profile_required', 'executive', 'Executive'); } } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 05:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 05:47 AM
I already informed on Saturday (2 days ago), the error you are showing doesn't relate to any client script.
it's a system log so nothing to do with your client script
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
‎03-24-2025 06:32 AM
So do we have other option to check root cause of this error and why my client script is not triggering.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2025 06:45 AM
coming to your 1st question, that's a generic message you can debug server side script
for your 2nd question why client script is not working?
1) are you comparing correct value in IF statement
2) did you add alert and see till which point client script runs?
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