where can I find description of GlideTableDescriptor

sergsalo
Kilo Explorer

I saw the usage of this object in some posts, but wasn't able to locate any documentation on it. Can anyone provide a link that explains what this object is and methods it supports?

thanks,

Serg

5 REPLIES 5

The SN Nerd
Giga Sage
Giga Sage

The constructor takes a table name as an argument



var gtd = new GlideTableDescriptor('incident');


gs.print(gtd.getName());



You can also use the static method as follows



var gtd = GlideTableDescriptor.get('incident');



The list of methods are as follows. I do not know what parameters they take.



displayField


getSequenceElements


getElementDescriptor


hashCode


getED


getDisplayField


canWrite


getPrimaryKeyName


hasTextIndex


getClass


hasIndex


isRotationExtension


isValidField


getStorageName


setElements


getLastElementDescriptor


getIndexDescriptors


getPrimaryKey


getDisplayElement


hasTableTextIndex


canCreate


isUpdateSynch


equals


getName


getSchema


getLabel


canRead


wait


getPrimaryKeys


getInDatabaseSchema


close


getSchemaList


isInPrimaryKey


getActiveSchema


getAccessPolicy


getActiveFieldNames


getSizeClass


getAllElementDescriptors


isValid


getDisplayName


isUpdateSynchCustom


toString


isReadReplicaBlacklisted


getTableSchema


getMetaDataXML


notify


getAlterAccess


getDBIRaw


getDBI


notifyAll


getOwnElementDescriptors


getReferenceTo


auditWanted


getMetaDataXMLForElements


canDelete



I hope this is helpful!



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

thanks Paul,


to rephrase my question "how did you find this out?". I guess my problem is to navigate around API and documentation. Some things are easy to find and they are explained in wiki, developer portal. Others, like GlideTableDescriptor, have no documentation about them (only can be found in some blog posts) though people are using it. I tried to search sys_script_include for the definition of GlideTableDescriptor but didn't find it.


It is a Java class and is not available as a script include.


I wrote a function to loop through every function for the object and print it out.



var obj = new GlideTableDescriptor('incident');


var result = [];


for (var id in obj) {


  try {


  if (typeof(obj[id]) == "function") {


  result.push( id );


  }


  } catch (err) {


  result.push(id + ": inaccessible");


  }


}


gs.print(result);



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

I should update this.



Tools like Xplore make it easy to find out.



All you need to do is this



new GlideTableDescriptor('incident');  



And you get this output:



find_real_file.png



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022