How to hide the "New" button after clicking on lookup icon of a reference field?

Smith Johnson
Tera Guru

Hello,

I have the "Configuration item" field in the incident form (reference field to the "cmdb_ci" table), as shown below:

SmithJohnson_0-1690785937604.png


After clicking on the lookup icon of this field, I see the list of records that I can select.

SmithJohnson_1-1690785990843.png

SmithJohnson_2-1690786093782.png

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.

 

 

7 REPLIES 7

Niklas Peterson
Mega Sage
Mega Sage

Hi,

An easy way is it to just remove the button in the list view.

NiklasPeterson_0-1690786659321.png
NiklasPeterson_1-1690786706707.png


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

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.

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

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.