GlideRecord query for specific inherited/child tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2012 01:42 PM
is there a way to query tables to exclude certain child tables?
for instance, i would like to query the task table and leave out planned_tasks. This way i can get all incidents, changes, problems, facilities, etc. etc without also grabbing projects, project tasks, etc. etc.
var tasks = new GlideRecord("task");
task.addQuery("actual_table_name", "ISNOT", "planned_task");
task.query();
If i can't do that then how would i get the TaskStateUtil instance of the actual table and not task? if i do a query on the task table i can get all kinds of different things, incidents, projects, project tasks. etc. etc. but when i load up the task state util for any of them all i get is the states for task no matter what overrides i have defined.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2012 10:10 AM
apparently it is not possible to query table hierarchy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2018 01:39 PM
You can use the following query...
task.addQuery('number','STARTSWITH','TASK');
Inside the planned_task table (control tab), change the Prefix to something else like PT.
That way it won't show in the query.