How to make variable editable on ritm after submit for some users only

Rajababu
Giga Guru

Hi ,

Can any help to create I want make editable variable fields on RITMS.

Any way to do it.

1 ACCEPTED SOLUTION

Hi ,

I found the way i need to resolved .

 

function onLoad() {

if(g_form.getValue('cat_item')!='sys id of catalog item' && !g_user.hasRole('itil'))

g_form.setVariablesReadOnly(true);


}

View solution in original post

6 REPLIES 6

Varsha21
Giga Guru

Make "Variable Editor Readonly" client script true which is written on sc_req_item table.

 

and use script like

 

if (g_user.hasRoleExactly('role_name')) {
 g_form.setVariablesReadOnly(false);
}

g_form.setVariablesReadOnly(true);

try this

 

Thanks

It's not working . still showed same thing

 

I created on load .

Hi ,

Below code i changed but ,it provide if user have itil ,User have that role he will able edit all variable under veditor for any items ,i want to restrict user only for one item only he can edit .

How I can do .

find_real_file.png

Upender Kumar
Mega Sage

Hi,

You can use below client script onLoad on Requested Item table:

 

function onLoad() {
if(document.getElementById('variable_map')){
$(variable_map).select("item").each(function (elmt){
try {

g_form.setDisabled('variables.' + elmt.getAttribute('qname'),true);
} catch (err) {
}
});

//Hide Attach Report containers
try{document.getElementById('container_aed9304c6fcb2100bd7ac5cbbb3ee439').style.display = 'none';}catch(e){}
try{document.getElementById('container_bb5596bf6f472100de7ee1b3dd3ee4f3').style.display = 'none';}catch(e){}
}
}