- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-07-2019 02:29 PM
I enjoy using this, that's why I wanted to share it. You ServiceNow Developers might find it useful.
In order to get the table details and descendants for underlying form, I have to go to Configure and then Table as bellow.
However, I just get to the table name for this form for descendant tables I have to go all the way.
This process is a bit cumbersome.
I have developed a basic thing to get the table name and descendants using the global UI Action for the underlying form as follows.
In this sample, I used the CMDB Linux Server.
The result:
When clicking on the table names, it navigates to table description.
Here are the development details.
- Create two Script Include files
TableUtilsCustom.js Runs on the server
TableUtilsCustomAjax.js Client callable
- Create a global UI Action.
Script:
function getTableName() {
try {
var table_name = g_form.getTableName();
copyToClipboard(table_name);
var gra = new GlideAjax("TableUtilsCustomAjax");
gra.addParam("sysparm_name", "getHierarchy");
gra.addParam("sysparm_table_name", table_name);
gra.getXMLWait();
var result = gra.getAnswer();
var gdw = new GlideModal("glide_warn", false, 400);
gdw.setTitle(getMessage('About table'));
gdw.setPreference('title', result);
gdw.render();
} catch (ex) {
g_form.addErrorMessage(ex);
}
}
Include files are attached.
Feel free to ask any question.
Hope you enjoy it.
Regards,
Yusuf
- 2,076 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Yusuf!
Thank you for sharing this nice trick! I like it a lot. 😄 ^_^
Maybe this can also be published on the Share website.
∴
Best regards from Switzerland
Shiva :¬,
If this reply assisted you, please consider marking it 👍Helpful.
This enables other customers to learn from this thread.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thank you Shiva.
Shared per your suggest.
Regards,
Yusuf