Adding a button to a form (Not form Header)

josephtucker
Giga Contributor

I'm looking to make a button on a form (Incident for example) that appears at the top of the form, but below the form's header.

I've included an image to demonstrate what I'm after.

IncidentImage.PNG

The purpose of this button is to eventually call a ui-page as a dialog popup window with specific information.

There would be certain conditions for this button to show (indicated by fields present in a table), as well as only show for certain roles.

I know a UI Action would add the button to the form header, but I'm curious about placing it as indicated in the image.

1 ACCEPTED SOLUTION

If you want to be able to put it anywhere on the form then you would have to go with the formatter. You can define your button using html/jelly in the ui macro, then call the ui macro from the formatter, which you can add anywhere on your form.


View solution in original post

4 REPLIES 4

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You can do this through a ui macro and formatter, but it is a lot less work just to use a ui action. What is the reason you don't want to use a ui action?



Edit: I've also just used a display business rule with gs.addInfoMessage() to put a link at the top of the form.


UI Action Form button adds the button to the form header (Next to Update, Save, Delete)


I need this button to appear above the fields (In this example, above Number and Urgency) in the form.


This is to sort of make the button seem like a banner. The intent was to make something pop out for certain users to see.


If you want to be able to put it anywhere on the form then you would have to go with the formatter. You can define your button using html/jelly in the ui macro, then call the ui macro from the formatter, which you can add anywhere on your form.


Cool!


I'll give that a go (tied up with a separate priority at the moment). Sounds like it will work for my needs.



Thanks a bunch!