unable to update short description(readonly field) in catalog task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 01:10 AM
Hello everyone,
I am facing an issue that is based on catalog task variable (yes/no type) we need to update catalog task short description which is a read only field.
Note: using catalog task activity in workflow we able to get short description's update based on catalog form value.
But here user needs to update catalog task variable from back end and based on that, short description needs to be updated.
below is the code, using this code once we change field value yes to no or no to yes, we able to see short description is updated but once we click on save button value is not saved.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
else{
var ga = new GlideAjax('getID');
ga.addParam('sysparm_name', 'getSysId');
ga.addParam('sysparm_sys_property_name', 'sys_id');
ga.getXML(managerFunc);
function managerFunc(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
var Unique_Value=g_form.getParameter("sysparm_id");
if (Unique_Value== answer){
if (g_form.getValue('check_this')=='Yes'){
g_form.setReadOnly('short_description',false);
g_form.setValue('short_description','xyz');
}
else{
alert('ghosh1');
g_form.setReadOnly('short_description',false);
g_form.setValue('short_description','abc');
}
}
}
//Type appropriate comment here, and begin script below
}
}
Any help would be highly appreciated
Thanks,
Sayan Ghosh
- Labels:
-
Request Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-02-2022 10:22 AM
Hello Sayan,
You must write onload script as well based on 'check_this' field then value will be retained on load as well. Mark my answer as correct or hit like based on impact.
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2023 10:57 AM
sorry for the above script,
its the wrong code that wrongly copied above.
please refer the below BR that currently working for order guides.