how to disable list edit for reference fields

Deepthi13
Tera Expert

hi team,

how to disable list edit for cmdb_ci_computer.location.country on computer table list layout. please suggest

1 ACCEPTED SOLUTION

Hi Deepthi,

Then I believe in that case you still need to write ACL field level from location table. In the advanced section using script try to do this

var index = gs.action.getGlideURI().toString().indexOf('location_list');

if(index == -1){

// it means it is not location table list layout so set answer as false

answer = false;

}

else{

answer = true; // allow edit when list layout of location table is opened

}

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

11 REPLIES 11

Hi Deepthi,

you need to select the location table within which there is country field.

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

but i don't want to make this for location table, this should only be read only for computer table list layout.

Hi Deepthi,

Then I believe in that case you still need to write ACL field level from location table. In the advanced section using script try to do this

var index = gs.action.getGlideURI().toString().indexOf('location_list');

if(index == -1){

// it means it is not location table list layout so set answer as false

answer = false;

}

else{

answer = true; // allow edit when list layout of location table is opened

}

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi ankur, this is worked when i place that script in place. And table name is location.country, it is working fine.

Note: country field is editing in list layout on location table but country field is disabled to edit in computer table which i expected.

But could please clarify 2 doubts,

1. i dint under stand how that script worked.. please explain briefly below lines,

var index = gs.action.getGlideURI().toString().indexOf('location_list');
if(index == -1){ 

2. if the same field is used in any other table like asset.. there also it disables list editing? 

if yes, how can we give more specifically to be on cmdb_ci_computer only.

find_real_file.png

find_real_file.png

Hi Deepthi,

Nice to hear that it worked.

1. i dint under stand how that script worked.. please explain briefly below lines,

a) it takes the url and it will check whether location table list layout is present or not; if not then block; if yes then allow

2. if the same field is used in any other table like asset.. there also it disables list editing? 

a) it would disable this list edit for all tables except location; What is your question here

Do you want to allow for asset table ? If yes then within else statement you will have to again check whether url contains asset_list; whatever table you want to allow you need to go and add else if statement for those 

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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