- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 07:34 AM
how to make a field editable and visible in ritm and task when assignment group = x in task or is changed to x.
I have a field called issue details it should be visible and editable only when assignment group = x in taskor is changed to x in task.
I created a catalog client script for this as given below:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var RequestItemId = g_form.getUniqueValue();
var taskGR = new GlideRecord('task');
taskGR.addQuery('request_item',equestItemId);
taskGR.query();
if(taskGR.next()){
var assignmentGroup = taskGR.assignment_group.getDisplayValue();
//var previousAssignmentGroup = g_form.getOriginalValue('assignment_group');
//Check if assignment group is x
if(assignmentGroup ==='x'){
//Make the 'issue details' field editable in catalog form
g_form.setReadOnly('issue_details',false);
}else{
g_form.setDisplay('issue_details',false);
g_form.setReadOnly('issue_details',true);
}
}
but when i am using it it is only satisfying one condition for me which is assignment group = x not if it is changed to x. Could anyone help me with this. I need a solution urgently.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 09:30 AM
You can create a UI policy like below
Add your catalog item and assignment group in condition
Add script like below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 09:28 AM
Hi @Ponnada
You cannot use Glide Record in client script. Also, You don't need a client script for the above requirement.
You can do this using a UI policy and avoid writing so much code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 09:30 AM
You can create a UI policy like below
Add your catalog item and assignment group in condition
Add script like below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2023 01:58 AM
Hi Manmohan,
Thank you so much. I changed the table to sc_task and did every thing else as in your reply.I also used a catalog ui policy for ritm. They are working.