The CreatorCon Call for Content is officially open! Get started here.

Variable Read only for Catalog Task

Arun87
Giga Contributor

Hi Team,

 We have created one form and it contain 10 variables. 5 variables are filled at the time of creating the request. Once it is approved by the line manager it will create  the catalog task1, in this task group owner need to fill the 3 variables. In this task 5 variables are read only. Once this task it is closed it will create other task2 requesting the group owner to fill other 2 variable. In this task2 previously filled 3 variables should be in read only. once task2 is closed it will create task 3 and all the variables should be in readonly. Please help me how to achieve this.

1 ACCEPTED SOLUTION

You can call me at 9885189192

View solution in original post

42 REPLIES 42

Hi Arun,

Let me know if the issue is resolved. 

Hi Arun,

try adding alert. what came in alert?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Alert if needed is not coming for  the catalog task

Hi Arun,

Can you make it as normal client script instead of catalog client script and use this script

Also do you want to set the field assigned_to readonly or some catalog variable

function onLoad(){

var shortDescription = g_form.getValue('short_description');
alert(shortDescription);
if(shortDescription == 'Tech Evaluation and Testing'){
alert("Entered if");
g_form.setReadOnly('assigned_to', true);
}
}

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

The below mentioned alert is working. Rest of the thing is not working.

var shortDescription = g_form.getValue('short_description');
alert(shortDescription);