I want to hide the "New" button on the list screen displayed from the reference field.

bonsai
Mega Sage

I would like to hide the "New" button from the list screen that appears when you click the "i" icon in the reference field.

I would like to leave the "New" button on the normal list screen transitioned from the module.

How should this be implemented?

If you can set the view on the list screen after clicking the "i" icon, you can hide it by setting the UI action, but...

 

small_list.JPG

2 ACCEPTED SOLUTIONS

harshav
Tera Guru

This is how it works if the user has create access to the reference table. if the users don't want to see that button then remove the create access on that table.

 

But if you want to customize the global new button then you can add this condition to it along with the exsisting one

!(RP.getParameterValue('sysparm_view')=='sys_ref_list' && RP.getParameterValue('sys_target')=='your_table_name')

View solution in original post

Tai Vu
Kilo Patron
Kilo Patron

Hi @bonsai 

The view when you click on the lookup icon is sys_ref_list.

You can leverage the RenderProperties API to set conditions in the UI Action or in the Omit new condition of List Control. Both of them should works.

Sample below specific for Requested for [requested_for] field in the Request [sc_request] table.

Omit new condition

 

RP.getParameterValue('sysparm_view')=='sys_ref_list' && RP.getParameterValue('sysparm_target')=='sc_request.requested_for';

 

 

Cheers,

Tai Vu

View solution in original post

5 REPLIES 5

SanjivMeher
Kilo Patron
Kilo Patron

I am wondering why does it show a list view to you when you click the i icon. It should take to the user record.


Please mark this response as correct or helpful if it assisted you with your question.

harshav
Tera Guru

This is how it works if the user has create access to the reference table. if the users don't want to see that button then remove the create access on that table.

 

But if you want to customize the global new button then you can add this condition to it along with the exsisting one

!(RP.getParameterValue('sysparm_view')=='sys_ref_list' && RP.getParameterValue('sys_target')=='your_table_name')

user wants create acces..but not from the new button ..is it possible?

Tai Vu
Kilo Patron
Kilo Patron

Hi @bonsai 

The view when you click on the lookup icon is sys_ref_list.

You can leverage the RenderProperties API to set conditions in the UI Action or in the Omit new condition of List Control. Both of them should works.

Sample below specific for Requested for [requested_for] field in the Request [sc_request] table.

Omit new condition

 

RP.getParameterValue('sysparm_view')=='sys_ref_list' && RP.getParameterValue('sysparm_target')=='sc_request.requested_for';

 

 

Cheers,

Tai Vu