Need to make a variable in a multirow variable set readonly in a catalog task

Likitha Naga
Tera Contributor

Hi,

 

We have a catalog item which uses a multirow variable set.

When a request is raised, the request generates 2 SCTASKS. The goal is to make variable 'ABC' read only in the MRVS of SCTASK1 and editable in SCTASK2.

 

Thanks in Advance.

1 ACCEPTED SOLUTION

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Likitha Naga 

How do you want to differentiate both the tasks?

1. Based on Short Description of the SCTASK -  you can write catalog client script on that catalog item which applies only on catalog tasks and add logic like below

if( g_form.getValue('short_description' ) ==  'ctask2_short_description')
g_form.setReadOnly('variable_name',false); //modify variablename accordingly
else
g_form.setReadOnly('variable_name',true);

2 or we can also write the logic to check if it's the second task that's attached to the RITM 

Write a Display BR on CTASK table which runs only for this particular item and set the scratchpad variable with the count based on created date.

 

 

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

3 REPLIES 3

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Likitha Naga 

How do you want to differentiate both the tasks?

1. Based on Short Description of the SCTASK -  you can write catalog client script on that catalog item which applies only on catalog tasks and add logic like below

if( g_form.getValue('short_description' ) ==  'ctask2_short_description')
g_form.setReadOnly('variable_name',false); //modify variablename accordingly
else
g_form.setReadOnly('variable_name',true);

2 or we can also write the logic to check if it's the second task that's attached to the RITM 

Write a Display BR on CTASK table which runs only for this particular item and set the scratchpad variable with the count based on created date.

 

 

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Hi @Voona Rohila ,

 

The solution you have mentioned works for a normal variable. But we need a variable in a multi row variable set to be editable.

 

Please see the attached screenshots for reference.

 Screenshot MRVS 1 shows a variable named 'Request ID'. That can be made read only based on the short description.

We have another multirow set below that variable. We need variable in that set to be read only for SCTASK 1.

 

Thanks in Advance.

 

Hi @Likitha Naga 

You can make it read-only using Catalog UI Policy but the requirement is based on catalog task description so that is not possible

 

Refer below article on how you can manage to hide/disable buttons/icons.

https://www.servicenow.com/community/developer-articles/disable-buttons-in-multirow-variable-set/ta-...

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP