Make Value Non-Editable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2023 01:25 AM
Hi Dev's,
I have requirement where in a List collector field on a catalog item default value should be non-editable.
*** User will be able to select other values in the field but user should not remove the default value .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2023 01:48 AM
Hi,
You cannot make only specific selection readonly in list collector.
You can use alternate way set the default value even if user remove it.
create onChange client script and use below logic:
var defaultValue = 'Your Value Here'; // sys_id of your record
if(newValue.indexOf(defaultValue)<0){
g_form.setValue('variable_name',newValue.toString()+','+defaultValue);
alert('Please do not remove the DefaultValue option');
}
You can use same login in onSubmit client script;
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2023 02:34 AM
The purpose of default is if user missed the value then system take the default value and save the record. As per my knowledge restricting default value is not a case here.
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]
****************************************************************************************************************