How can you see whether a record has child records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 07:26 AM
Currently using an onSubmit client script to check if certain values have been populated.
I would like to omit this check if the record in question has child records related to it. Specifically, child project tasks related to a parent project task (pm_project_task)
Is there a best practice method of doing this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 07:31 AM
@MBarrott You can use a GlideAjax + Script Include to check if the current task has child project tasks. You can refer to https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/client/c_GlideAjaxAPI to know more about it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 07:36 AM
Create a GlideAjax script include to be called from your client script that queries the table for <parent> = <sys_id of the record>. See examples in your instance, search with 'script', 'contains', "GlideAjax".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 07:40 AM
Hi @MBarrott ,
Please refer to below thread:
Plz mark my solution as Accept, If you find it helpful.
Thanks & Regards,
Sumanth Meda