- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 09:46 PM
Hi @Blitz,
Right click on related link and it will open in different tab and set the condition as current.state=='2' || current.state=='2'. it depends on your requirement what state do you want hide.
Please accept my solution if it works for you and thumps up.
Thanks
Jitendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 09:47 PM
Hi @Blitz ,
Your condition in the UI action determines when the UI action is displayed. In your case it sounds like you need something like this:
current.state == 'In-progress' (You can use the backed value)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 09:51 PM - edited 05-30-2024 10:05 PM
Hello,
-
Configure the UI Action:
- Name: Give your UI Action a descriptive name.
- Table: Select the table where you want the related link to appear (e.g.,
incident). - Action name: Provide an action name (e.g.,
hide_related_link). - Show Insert: Check this if you want the link to be available on new records.
- Show Update: Check this if you want the link to be available on existing records.
- Condition: This is where you'll add the condition to hide the related link.
Sample Condition Script
Here's an example condition script that hides the related link if the state is "In Progress":
// Check if the current record's state is "In Progress"
// Replace `state` with the actual field name if it's different
// Replace `2` with the actual value for "In Progress" if different
current.state == 'In Progress';
Regards,
Vaishnavi Lathkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2024 10:25 PM - edited 05-30-2024 10:25 PM
Is there a script in the script field for this configuration ? like if conditions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2024 01:24 AM
Hello Blitz,
To apply conditions at the script level and ensure related links are not hidden based on specific states, you need to utilize the conditions field provided in the ServiceNow UI action. This approach allows you to specify the criteria under which related links should be displayed or hidden, ensuring that the links remain visible or become hidden according to the defined states. By configuring the conditions field appropriately, you can achieve the desired behavior for related links based on the specific conditions you have set.