How to get column datatype from glideElement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2012 03:46 AM
In a script include I want to get the column datatype.
var gr = new GlideRecord('cmdb_ci_solaris_server');
gr.setLimit(20);
gr.query();
if (gr.next())
{
var ele = gr.getElement('name');
}
from the above code I get the glideElement. Is there any method which will return the datatype (Internal_Type) of the column?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2012 04:48 AM
Why don't you query sys_dictionary for the table and particular column to get the data type? There may be a method to get the internal type too, I am not too sure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2012 05:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2012 06:59 AM
It worked ... values can be retrieved using following functions.
var val = gr.getElement('u_parent').getED();
var Reference = val.getReference();
var ReferenceQual = val.getReferenceQualifier();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2012 08:46 AM
Thanks Chris!