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.

"NEW" button that opens new record in table

eyala
Tera Contributor

Hey, how can I make the new button

eyala_1-1726746087455.png

 

to take me  the portal page ? 

eyala_2-1726746906479.png

 

6 REPLIES 6

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

New is a global ui action, if you want to alter the behavior you will have toi create a custom ui action to do so.

I would recommend you Override the OOB ui action and create a new one with same name, this way it will look the same as oob and also 2 new won't show up.

Here is a link that explains how to override ui action

Override a UI action for an extended table (servicenow.com)

 

Once you have the new custom button, then you add the code to redirect user to portal (catalog link).

-Anurag

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @eyala 

 

Better create a module instead of button. changing in OOTB New button will cause issue.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Sid_Takali
Kilo Patron

Hi @eyala Try to add a below code in New UI Action and let's see if it works or not. Modify URL accordingly

action.setRedirectURL('sp?id=sc_cat_item&sys_id=3f1dd0320a0a0b99000a53f7604a2ef9&referrer=popular_items')

 

Just to add, don't add this on the New UI Action as is as its shared and Global.

You need to override and create a new UI Action for your table.

-Anurag