How to hide the "New" button after clicking on lookup icon of a reference field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2023 11:51 PM
Hello,
I have the "Configuration item" field in the incident form (reference field to the "cmdb_ci" table), as shown below:
After clicking on the lookup icon of this field, I see the list of records that I can select.
However, I also see the "New" button. This is something that I want to hide. Users should be able only to select existing values and not creating new ones. How can I achieve this?
Your ideas are welcomed.
Thank you,
Smith.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 12:03 AM
Hi,
An easy way is it to just remove the button in the list view.
This will also affect the List view of the table.
But the reason why the New button is there is that the user have create access on the table. That is something you may or may not want to address.
Regards,
Niklas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 12:13 AM
Hi Niklas,
thanks for your reply.
Unfortunately, this solution will not work for us, since the New button should be visible on the list view of the table.
Any other ideas are welcomed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 12:22 AM
Hello again,
Do you create CIs directly in the Configuration Item (cmdb_ci) table using the New button on the list view? This is the only list that will be affected. Child tables are not affected by hiding the New button on the cmdb_ci table. So you can still have the New button on more specific CI classes.
Regards,
Niklas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 12:30 AM
Hello @Smith Johnson
Greetings.
you can write below script for Omit New Condition.
var current_view = RP.getParameterValue('sysparm_view');
// gs.log ("view is " + current_view);
var answer;
if (current_view == "sys_ref_list") {
answer = true;
} else {
answer = false;
the above script will hide new button for pop up lists.
Please hit the thumb and Mark as correct based on Impact!!
Kind Regards,
Ravi Chandra.