Disable "NEW" option in City & State lookup

Hello,

We want to disable the ability to use the "New" City/State option in the City/State lookup fields of an address. What is the best way to accomplish this?

Like 0

Like

3 comments
Best reply

Hi Allen Dsouza,
 

This button is displayed if the Lookup has an edit page. If we are talking about a selection card from a lookup, the "getSelectionControlsConfig" method in the "LookupPageViewGenerator" schema is responsible for loading the list of edit pages.
 

There is no instruction, but the "BaseLookupPageV2" schema is responsible for this page \ window, the "Add" button name is: "SeparateModeAddRecordButton", the "ActionsButton" - it's action button. You can replace and customize the visibility of these buttons as you need.
 

P.S. If you have an option to hide it without using code, I'm suggesting you to do it, just by changing "Lookup view" from "Selection window" to "List" and there will be no option to add "New" City/State. (Example attached below)

Best Regards, 

Bogdan L.

Dear Allen,

 

Thank you for your question!

 

The best way to accomplish the restrictions to add new records to a lookup without development would be to update the Object Permissions.

 

Navigate to the [Object Permissions], find there the required lookup, and disable the "Create" option for "All employees" (or for a different group if you are using them):

 

And save. Make sure to "Update the record permissions" in the Action drop-down menu.

 

The result would be like in the screenshot below:

 Hope this helps!

 

Thank you, hope you have a great day!

 

Regards,

Danyil

Danyil Onoprienko,

Thank you for the suggestion! Due to some complex security setup in the system, we are considering using code disable/hide the "NEW" option on the lookup. Is there a way to do this?

Hi Allen Dsouza,
 

This button is displayed if the Lookup has an edit page. If we are talking about a selection card from a lookup, the "getSelectionControlsConfig" method in the "LookupPageViewGenerator" schema is responsible for loading the list of edit pages.
 

There is no instruction, but the "BaseLookupPageV2" schema is responsible for this page \ window, the "Add" button name is: "SeparateModeAddRecordButton", the "ActionsButton" - it's action button. You can replace and customize the visibility of these buttons as you need.
 

P.S. If you have an option to hide it without using code, I'm suggesting you to do it, just by changing "Lookup view" from "Selection window" to "List" and there will be no option to add "New" City/State. (Example attached below)

Best Regards, 

Bogdan L.

Show all comments