GlideElementDescriptor - Scoped, Global

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:12分
  • The GlideElementDescriptor API provides information about individual fields in a glide record.

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

    GlideElementDescriptor - getAttachmentEncryptionType()

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

    This method is for use with the Edge Encryption plugin.

    表 : 1. Parameters
    Name Type Description
    None
    表 : 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

    GlideElementDescriptor - getEncryptionType()

    Returns the element's encryption type.

    This method is for use with the Edge Encryption plugin.

    表 : 3. Parameters
    Name Type Description
    None
    表 : 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

    GlideElementDescriptor - getInternalType()

    Returns the element's internal data type.

    表 : 5. Parameters
    Name Type Description
    None
    表 : 6. Returns
    Type Description
    String The element's internal data type.
    Possible values:
    • boolean
    • char
    • collection
    • conditions
    • date
    • decimal
    • documentation_field
    • domain_id
    • due_date
    • email
    • field_name
    • file_attachment
    • float
    • glide_date
    • glide_date_time
    • glide_duration
    • glide_list
    • GUID
    • html
    • image
    • integer
    • long
    • longint
    • multi_two_lines
    • journal
    • journal_input
    • numeric
    • order_index
    • password
    • ph_number
    • reference
    • script
    • script_plain
    • string
    • sys_class_name
    • table_name
    • template_value
    • timer
    • translated_field
    • url
    • user_image
    • user_input
    • user_roles
    • video
    • workflow
    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

    GlideElementDescriptor - getLabel()

    Returns the element's label.

    表 : 7. Parameters
    Name Type Description
    None
    表 : 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

    GlideElementDescriptor - getLength()

    Returns the element's length.

    表 : 9. Parameters
    Name Type Description
    None
    表 : 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

    GlideElementDescriptor - getName()

    Returns the element's name.

    表 : 11. Parameters
    Name Type Description
    None
    表 : 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

    GlideElementDescriptor - getPlural()

    Returns the element's plural label.

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

    Output:

    Incidents

    GlideElementDescriptor - hasAttachmentsEncrypted()

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

    This method is for use with the Edge Encryption plugin.

    表 : 15. Parameters
    Name Type Description
    None
    表 : 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

    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.

    表 : 17. Parameters
    Name Type Description
    None
    表 : 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

    GlideElementDescriptor - isChoiceTable()

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

    Choice fields cannnot be encrypted.

    表 : 19. Parameters
    Name Type Description
    None
    表 : 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

    GlideElementDescriptor - isEdgeEncrypted()

    Returns true if an element is encrypted.

    This method is for use with the Edge Encryption plugin.

    表 : 21. Parameters
    Name Type Description
    None
    表 : 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

    GlideElementDescriptor - isMandatory()

    Determines whether the element is mandatory and must contain a value before the record can be saved.

    表 : 23. Parameters
    Name Type Description
    None
    表 : 24. Returns
    Type Description
    Boolean Flag that indicates whether the associated element is mandatory and must contain a value before the record containing the element can be saved.

    Possible values:

    • true: element must contain a value; mandatory field
    • false: element does not have to contain a value

    This example shows how to check whether the name field is mandatory.

    var isRecordValid;
    var now_GR = new GlideRecord('my_table');
    var field = now_GR.getElement('name');
    var elementDescriptor = field.getED();
    now_GR.query();
    while (now_GR.next()) {
    if (elementDescriptor.isMandatory() && !now_GR.name) {
           isRecordValid = false;
      }
    }

    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.

    表 : 25. Parameters
    Name Type Description
    None
    表 : 26. 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