Should variables carried over to the RITM be read only?

paw2
Tera Expert

After submitting a request, the variables are carried over to the RITM record as editable.   Do most companies leave as editable or make read only?   What are the ramifications either way?   If best practice is to make read only, what is the best way?

find_real_file.png

1 ACCEPTED SOLUTION

Ct111
Giga Sage

I found the most appropriate solution for this , incase there are lot of catalog items and you want to implement on all the variables.

Then just create one UI policy on sc_req_item table

and in condition "select state is "one of"  and "select all states" , so that it will always be true

 

keep onLoad checbox checked and then in script put this

 

find_real_file.png

 

ONce this is created , raise any catalog item and when you see RITM variables all of them will be readonly by default.

And no need to worry abt worknotes and additional comments as people can still log into that.

And most important you can test in different views as well like default and workspace it will be success.

 

Mark my ANSWER as CORRECT and HELPFUL if it works

 

View solution in original post

6 REPLIES 6

Chuck Tomasi
Tera Patron

Hi Patricia,



Most make them read-only as they are part of the original request, may be used as FYI for approvals, etc. and should not be changed once the process has begun. There are exceptions to every rule, of course.



The best way to make the variables read-only is with a catalog UI policy. You can have it apply only to the request item (and not to the catalog item when the user is filling it out.)



Service Catalog UI Policy - ServiceNow Wiki


Uncle Rob
Kilo Patron

I take a far more liberal view of what variables are and should be used for.


I tend to make variables read only via UI Policy / Script when I specifically want them read only.   Otherwise I leave them open or hidden.



On many an occasion I've used variables as a "just in time" data element.



Say we're on the 4rth step of an onboarding workflow.   This task is for someone to see if the network jack needs patching.   If yes, the workflow splits down a new path.   If not, continue forward.   What do you do in this case?   Add a new field to your sc_task table?   No.   I use a variable that will appear only on that sc_task.


sundeep6
Kilo Contributor

If you don't want to individually set each catalog item to read-only by using Service Catalog UI Policy, and instead want all variables on a particular form (request item, SC task, etc) to be read-only for everybody after the request is submitted, the script shown at the bottom of this page works well (incl in Geneva): http://www.servicenowguru.com/scripting/business-rules-scripting/variables-form-readonly/



I've copied it below for ease of reference:



All Variables Readonly Client Script
Name: All Variables Readonly
Table: Incident, Change request, Request item, Catalog task, wherever!
Type: onLoad



function onLoad(){
      try{
            //Get the 'Variables' section
            var ve = $('variable_map').up('table');
            //Disable all elements within with a class of 'cat_item_option'
            ve.select('.cat_item_option', '.slushselectmtm', '.questionsetreference').each(function(elmt){
                  elmt.disabled = true;
            });
            //Remove any reference or calendar icons
            ve.select('img[src*=reference_list.gifx]', 'img[src*=small_calendar.gifx]').each(function(img){
                  img.hide();
            });
            //Hide list collector icons
            ve.select('img[src*=arrow]').each(function(img){
                  img.up('table').hide();
            });
      }
      catch(e){}
}


I just tried this in Helsinki against requested items (sc_req_item) but it didn't work.


Also the article mentions this workaround shouldn't be used from Calgary onwards