- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2024 12:38 PM
When state is new , it shows the Add button in related list
But when state is closed , it does not show the Add button on related list
Is there any way to show Add button in related list when state is closed
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 01:49 AM
Hi @Asha Pathak I am using OR condition here so as long as the parent table is problem, the 1st condition (parent.sys_class_name == 'problem') will execute and will ignore the other condition (parent.active == true), for other tables the parent.active will be true. this way there is no impact for other tables and condition works as expected.
Does it work? If yes please accept the solution:)
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 06:31 PM - edited 04-02-2024 06:53 PM
HI @Asha Pathak after checking itseems OOB servicenow you cannot add a CI to the closed records, we would need to do a changes to the OOB script include AssociateCIToTask.
Modified script:
After modifying the above function CI gets added to the closed records
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 01:22 AM
Hi @Asha Pathak right click over there under affected ci related list and go to UI Action and open the UI action "ADD" and share the conditions to me
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 01:26 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 01:29 AM
Hi @Asha Pathak updated the condition for problem record to show add button if state is closed if parent table is problem then add button will be visible and it will not check for parent.active.
Cond:
RP.isManyToMany() && (new ChangeProposed(parent)).canAddCI() && current.canCreate() && (parent.sys_class_name == 'problem' || parent.active == true) && gs.getProperty('com.snc.task.associate_ci').indexOf(parent.sys_class_name) > -1
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 01:46 AM
@Harish KM how it works (parent.sys_class_name == 'problem' || parent.active == true) ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 01:49 AM
Hi @Asha Pathak I am using OR condition here so as long as the parent table is problem, the 1st condition (parent.sys_class_name == 'problem') will execute and will ignore the other condition (parent.active == true), for other tables the parent.active will be true. this way there is no impact for other tables and condition works as expected.
Does it work? If yes please accept the solution:)
Harish