Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to hide New button from the list view which is opened by clicking on reference icon

Community Alums
Not applicable

Hi Team,

 

I have created a field called shipping address as in the below screenshot, its a reference field. After we click on the reference icon, it opens the list of locations(cmn_location), I do not want the New button to be visible there.

Note:The New button should be visible when we open cmn_location.LIST ,Or directly open the locations

 

Ankur20_0-1685456588553.png

 

1 ACCEPTED SOLUTION

@Community Alums 

I did the same for problem_id field on incident table and it removed new button on lookup list

if(RP.getParameterValue('sysparm_view') == 'sys_ref_list' && RP.getParameterValue('sysparm_target') == 'incident.problem_id')
	answer = true;
else
	answer = false;

AnkurBawiskar_4-1685542301084.png

 

 

It's showing when I opened problem list using problem.list

AnkurBawiskar_0-1685541914515.png

New button is hidden on lookup list

AnkurBawiskar_2-1685542006515.png

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

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

View solution in original post

5 REPLIES 5

@Community Alums 

check my latest above comment and the working solution.

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