hide/show, ui action button

Ak_12
Tera Contributor

on my form i have an UI action button name (check inventory), this button should hide once a form is submitted or record get created. 

4 REPLIES 4

Anubhav24
Mega Sage
Mega Sage

To hide or show the UI Action button , you need to provide some conditions in the condition field present on that particular UI Action , once the record is created you might have some values on your form based on which you can control the visibility of the UI Action , you can refer to existing OOB UI action like Reopen on incident form

manjusha_
Kilo Sage

Hi Avi,

In the ui action condition just add below line-

current.isNewRecord()

Mark my answer as correct if it helps

Thanks,

Manjusha Bangale

raphaelcrv
Kilo Guru

To hide the "check inventory" UI action button on a form after the form is submitted or the record is created, you can use a UI policy in ServiceNow.

Here are the general steps to create a UI policy that hides a UI action button:

  1. Open the form for the table where the UI action button is located.

  2. Click the "Configure" button in the banner at the top of the form.

  3. Click "UI Policies" in the left-hand navigation.

  4. Click the "New" button to create a new UI policy.

  5. Enter a name for the UI policy and set the "Table" field to the table where the UI action button is located.

  6. Under "Advanced", set the "Type" field to "Advanced".

  7. In the "Advanced" field, enter a condition that checks whether the record has been submitted or created. For example, you might use a condition like this:

 

current.sys_id.nil()

 

This condition checks whether the sys_id field is empty, which indicates that the record has not yet been submitted.

  1. Under "UI Actions", select the "check inventory" UI action button.

  2. Set the "Visible" field to "No".

  3. Save the UI policy.

With this UI policy in place, the "check inventory" UI action button will be hidden on the form once the record has been submitted or created. Note that you may need to adjust the condition in step 7 to match the specific requirements of your use case. For example, you may need to check a different field or use a different comparison operator.

If my response was helpful and/or provided a solution, please consider marking it as such. Thank you!

Hello @raphaelcrv ,

I'd love to use your solution instead of the JQuery I've been using.
However, I'm confused by your response at #6 and below.  Those features do not appear to exist in UI Policy or UI Policy actions. (Vancouver release)

UI Policies have an "Advanced" view, but don't have an "Advanced" field, or a "Type" field that could be set to advanced.
UI Policy Actions don't have those fields either, and the UI Policy actions only allow selection of fields (or variables depending on policy type), but not UI Actions.

 

Can you provide a screenshot of that configuration for clarity?

Thanks,
-Stephen