Sceneario question on incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
There is incident form. On incident form there is, incident task related list. On incident task related list there is new & add UI action. I want to show that ui action if incident is in in progress state. How will you achieve?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Ahoy @pratikdeshp,
for any related list in general, having the two buttons (UI Actions) NEW and ADD (or EDIT) is for two scenarios:
* NEW is creating a non-existing record and then adding it to the related list,
* ADD or EDIT is adding record that already exists, nothing new is created, it is only associated to the record (parent)
Does this make any sense? If your question was not answered, please try to put it differently for me to better understand it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi glideFather,
Yes, that makes sense. Thank you for explaining the difference between New and Add.
My requirement is to show both buttons in the Incident Tasks related list only when the parent Incident state is In Progress. If the Incident is in any other state, both buttons should be hidden.
Could you please guide me on how to achieve this in ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
sure @pratikdeshp, just be aware that having these buttons available might impact other tables/lists as well.
Select the Form/Table where the related list is located and scroll to it - then click right mouse button on any of the Column label to get the Configure > List control:
and it lets you set the conditions for New and Edit buttons:
Omit means to leave it out from the list.
If this is not going to enable it, then you might want to go to UI Actions [sys_ui_action] table
https://yourDomain.service-now.com/sys_ui_action_list.do
Remember also that if you add a button to create a record in that list and user who access that related list doesn't have rights to create records there, they will not see the button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @pratikdeshp ,
You can acheive this using this omit condition script
var answer;
if (parent.state == 2)
{
answer=false;
}
else{
answer=true;
}
answer;
Output :
when incident state='in progress'
When incident state!='in progess'
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya
