GlideElementDescriptor - Scoped

The scoped GlideElementDescriptor API provides information about individual fields.

There is no constructor for this class. Use the GlideElement getED() method to obtain a GlideElementDescriptor object.

Scoped GlideElementDescriptor - getAttachmentEncryptionType()

Returns the encryption type used for attachments on the element's table.

This method is for use with the Edge Encryption plugin.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
String The encryption type used on attachments. Returns null if attachments on the element's table are not being encrypted.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');

var field = grInc.getElement('priority');
var ed = field.getED();

var isEdge = ed.getAttachmentEncryptionType();
gs.info(isEdge);

Output: null

Scoped GlideElementDescriptor - getEncryptionType()

Returns the element's encryption type.

This method is for use with the Edge Encryption plugin.

Table 3. Parameters
Name Type Description
None
Table 4. Returns
Type Description
String The element's encryption type. Returns null if the element is not encrypted.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');

var field = grInc.getElement('priority');
var ed = field.getED();

sEdge = ed.getEncryptionType();
gs.info(isEdge);

Output: null

Scoped GlideElementDescriptor - getInternalType()

Returns the element's internal data type.

Table 5. Parameters
Name Type Description
None
Table 6. Returns
Type Description
String The element's internal data type.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
 
var field = grInc.getElement('priority');
var ed = field.getED();
 
var isEdge = ed.getInternalType();
gs.info(isEdge);
Output:
integer

Scoped GlideElementDescriptor - getLabel()

Returns the element's label.

Table 7. Parameters
Name Type Description
None
Table 8. Returns
Type Description
String The element's label.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
 
var field = grInc.getElement('priority');
var ed = field.getED();
 
var isEdge = ed.getLabel();
gs.info(isEdge);

Output: Priority

Scoped GlideElementDescriptor - getLength()

Returns the element's length.

Table 9. Parameters
Name Type Description
None
Table 10. Returns
Type Description
Number The element's size.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
 
var field = grInc.getElement('priority');
var ed = field.getED();
 
var isEdge = ed.getLength();
gs.info(isEdge);

Output: 40

Scoped GlideElementDescriptor - getName()

Returns the element's name.

Table 11. Parameters
Name Type Description
None
Table 12. Returns
Type Description
String The element's name.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
 
var field = grInc.getElement('priority');
var ed = field.getED();
 
var isEdge = ed.getName();
gs.info(isEdge);

Output: priority

Scoped GlideElementDescriptor - getPlural()

Returns the element's plural label.

Table 13. Parameters
Name Type Description
None
Table 14. Returns
Type Description
String The element's plural label.
var gr = new GlideRecord('incident');
gr.query();
var ed = gr.getED();
gs.info(ed.getPlural());

Scoped GlideElementDescriptor - hasAttachmentsEncrypted()

Returns true if an encrypted attachment has been added to the table.

This method is for use with the Edge Encryption plugin.

Table 15. Parameters
Name Type Description
None
Table 16. Returns
Type Description
Boolean Returns true if an encrypted attachment has been added to the table.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');

var field = grInc.getElement('priority');
var ed = field.getED();

var isEdge = ed.hasAttachmentsEncrypted();
gs.info(isEdge);

Output: false

Scoped GlideElementDescriptor - isAutoOrSysID()

Returns true if the element is an automatically generated or system field.

Automatically generated and system fields cannot be encrypted. This method is for use with the Edge Encryption plugin.

Table 17. Parameters
Name Type Description
None
Table 18. Returns
Type Description
Boolean True if the element is automatically generated or a system field.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');
var field = grInc.getElement('priority');
var ed = field.getED();

isEdge = ed.isAutoOrSysID();
gs.info(isEdge);

Output: false

Scoped GlideElementDescriptor - isChoiceTable()

Returns true if the element is defined as a dropdown choice in its dictionary definition.

Choice fields cannnot be encrypted.

Table 19. Parameters
Name Type Description
None
Table 20. Returns
Type Description
Boolean Returns true if the element is defined as a dropdown choice. Returns true even if there are no entries defined in the choice table. The last choice type, suggestion, does not return true.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');

var field = grInc.getElement('priority');
var ed = field.getED();

var isChoiceTable = ed.isChoiceTable();
gs.info(isChoiceTable);

Output: true

Scoped GlideElementDescriptor - isEdgeEncrypted()

Returns true if an element is encrypted.

This method is for use with the Edge Encryption plugin.

Table 21. Parameters
Name Type Description
None
Table 22. Returns
Type Description
Boolean Returns true if the element is encrypted, false otherwise.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');

var field = grInc.getElement('priority');
var ed = field.getED();

var isEdge = ed.isEdgeEncrypted();
gs.info(isEdge)

Output: false

Scoped GlideElementDescriptor - isVirtual()

Returns true if the element is a virtual element.

A virtual element is a calculated field as set by the dictionary definition of the field. Virtual fields cannot be encrypted.

Table 23. Parameters
Name Type Description
None
Table 24. Returns
Type Description
Boolean Returns true if the element is a virtual element.
var grInc = new GlideRecord('incident');
grInc.query('priority', '1');

var field = grInc.getElement('priority');
var ed = field.getED();

var isVirtual = ed.isVirtual();
gs.info(isVirtual);

Output: false