Shamma Negi
Kilo Sage
Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
01-18-2024
01:36 AM
Hi All,
Today I would be covering the list of parent tables for the table given below:
GlideRecordUtil - getTables(String tableName)
Returns a Java ArrayList of the ancestors of the specified table name.
For example, given cmdb_ci_linux_server, this would return cmdb_ci_linux_server, cmdb_ci_server, cmdb_ci_computer, cmdb_ci_hardware, cmdb_ci, and cmdbr.
ParametersName Type Description
| tableName | String | Name of the table. |
ReturnsType Description
| ArrayList | List of ancestors of the specified table. |
Example
The following example shows the ancestors of the cmdb_ci_linux_server table.
var tables = new GlideRecordUtil().getTables("cmdb_ci_linux_server");
gs.info("Tables returned: " + tables);
Output:
Tables returned: [cmdb_ci_linux_server, cmdb_ci_server, cmdb_ci_computer, cmdb_ci_hardware, cmdb_ci, cmdb]
Another Example:
Inputs
var tables = new GlideRecordUtil().getTables("incident");
gs.info("Tables returned: " + tables);
gs.info("Tables returned: " + tables);
Outputs:
Hope this helps you.
I hope this article helpful. Please mark it as helpful and bookmark if you like it.
Regards,
Shamma Negi
2 Comments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
