- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 01:12 AM
How to check both Read only and Mandatory in Variable in Record Producer?
What scripts should I put in Default Value?
Any help would be appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 05:10 AM
Should it be when form loads or based on some variable change?
When form loads -> onLoad catalog client script
When variable changes -> onChange catalog client script on that variable
Nothing to do with Default value. Default value is used to auto-populate variable when form loads
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
12-20-2023 10:06 PM
Thank you for marking my response as helpful.
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
12-20-2023 03:50 AM
Hi @Daemon5
You can do via catalog UI policy but either make it read only or mandatory at a given point of time.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 05:10 AM
Should it be when form loads or based on some variable change?
When form loads -> onLoad catalog client script
When variable changes -> onChange catalog client script on that variable
Nothing to do with Default value. Default value is used to auto-populate variable when form loads
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
12-20-2023 09:59 PM
Thank you so much for the information.
I would like to set Read Only and Mandatory when Form load in Catalog client script.
I have tried the following script, but it only executes ReadOnly.
````
function onLoad() {
g_form.setReadOnly('fieldsname', true) && g_form.setMandatory('fieldsname', true);
}
````
Sorry for being a newbie, any suggestions on how to improve the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 10:03 PM