- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 09:52 PM
hi team,
how to disable list edit for cmdb_ci_computer.location.country on computer table list layout. please suggest
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 10:57 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 10:47 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 10:49 PM
but i don't want to make this for location table, this should only be read only for computer table list layout.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 10:57 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 11:18 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2019 11:31 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader