- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 10:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 11:47 PM
Open the related list table's UI actions search for the "new" ui action and on the new ui action form view uncheck the list banner button checkbox
It will remove the new button from related list
For e.g On the incidents form if you want to remove new ui action from child incident related list then type incident.config > UI action> select the new ui action button> on the new ui action form view uncheck the list banner button checkbox
Note : As I was doing removing the new button from child incident i have navigated to incident table
If you want to remove from any other related list the table will be differ keep in mind
If my answer is helpful then please mark it as helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2024 12:07 AM - edited ‎04-11-2024 12:11 AM
Hi @Linda Eju ,
I checked your problem and tried in my PDI and it working fine for me
Before :
After:
Right click on related list and click "List Control".
Add below code and it will work
var answer ;
gs.log("Checck log incidnet 222 = " + parent.child_incidents);
if (parent.child_incidents <= 0) { //Do not remove the 'New' button
answer = false ;
}
else { //Remove the 'New' button
answer = true ;
}
answer ;
Please mark correct and helpful if it works for you
Thanks and Regards
Sarthak

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 11:10 PM
An idea:
- Create a before display business rule and calculate the number of the related records (use GlideAggregate)
- Put the value in g_scratchpad container
- Copy the global UI action "new" for related list to your specific table with the same action name
- In the condition line of the UI Action check g_scratchpad content.
NOT tested!
I will always try to give a meaningful and valid answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 11:36 PM
Hi @Linda Eju
You can do a simple query to validate if there're existing records associated to the parent or not.
Sample below.
var gr = new GlideRecord(current.getTableName());
gr.addQuery('task', parent.getUniqueValue());
gr.setLimit(1);
gr.query();
answer = gr.hasNext();
Incident Affected CIs
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2024 11:47 PM
Open the related list table's UI actions search for the "new" ui action and on the new ui action form view uncheck the list banner button checkbox
It will remove the new button from related list
For e.g On the incidents form if you want to remove new ui action from child incident related list then type incident.config > UI action> select the new ui action button> on the new ui action form view uncheck the list banner button checkbox
Note : As I was doing removing the new button from child incident i have navigated to incident table
If you want to remove from any other related list the table will be differ keep in mind
If my answer is helpful then please mark it as helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2024 12:07 AM - edited ‎04-11-2024 12:11 AM
Hi @Linda Eju ,
I checked your problem and tried in my PDI and it working fine for me
Before :
After:
Right click on related list and click "List Control".
Add below code and it will work
var answer ;
gs.log("Checck log incidnet 222 = " + parent.child_incidents);
if (parent.child_incidents <= 0) { //Do not remove the 'New' button
answer = false ;
}
else { //Remove the 'New' button
answer = true ;
}
answer ;
Please mark correct and helpful if it works for you
Thanks and Regards
Sarthak