save as draft functionality not working as expected in catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2025 06:23 AM
When a catalog request is saved as draft, on the draft record few conditionally dependent variables are hidden even when they are made visible on normal request form and few variable values are cleared. Please let me know if this can be solved without disturbing existing scripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2025 11:51 PM
Hi @Ankur Bawiskar, sorry for the delay in response.
As you mentioned that we can ensure that ui policies or client scripts doesn't run in that mode,can you please let me know how to do that.
Also in my client script browser url I can't see edit=draft. In this case, what am I supposed to do. Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2025 08:03 AM
when you click on view my drafts and click the draft version, it opens up your catalog item and pre-fills your variable information
when this happens did you check what's there in the URL?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2025 08:08 AM
@Ankur Bawiskar
Yes, I found it now on draft record browser url. In that case, what am I supposed to do now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2025 07:44 PM
ensure that your onload catalog client scripts don't run in that case
if(url contains draft){
// don't do anything
}
else{
// your logic
}
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
‎04-16-2025 01:50 AM
@Ankur Bawiskar
Can we also use if(g_form.isnewRecord()). If it's not a new record then return else logic works. Does this work