- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 03:43 AM
Hello,
I wrote an on submit script to make attachment mandatory that is visible on service portal or esc, but this script is not running on glideapp.servicecatalog_cat_item_view. Below screenshot for your reference. Please suggest .
I have written 2 same on submit script, one for desktop and other for mobile/service portal.
This script is working on Service Portal but not on glideapp.
When I selected all in catalog client scripts I got below error , so created two separate catalog client scripts.
Script:
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 04:36 AM
Ensure the script I've provided you with is in an onsubmit catalog client script with the UI Type of 'desktop'. Delete your other script(s) you've created as they're not needed. Then use the checkbox function I mentioned previously to control the mandatory attachment requirement in the portal.
TL;DR - The script is making attachments mandatory in the glideapp backend view, the OOB functionality of the "Mandatory attachments" checkbox on the catalog item is controlling the portal/mobile view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2024 04:08 AM
Hello @Harsha34
I also noticed your script again, and it seems you've used DOM manipulation. While it works, it's generally not recommended as a best practice. Instead of adding custom logic to make attachments mandatory, you can easily set this requirement directly from the catalog item record.
In the Portal tab, there's an option to make attachments mandatory. Just check that box, and it will enforce the attachment requirement for that catalog item.
If you have any further questions or need assistance, feel free to ask!
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Regards,
Aniket
