---
sourceDocument: Xanadu API 참조
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - ko-KR

ft:publication_title :

    - Xanadu API 참조

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideElement - 범위 지정됨

# GlideElement - 범위 지정됨 {#ariaid-title1}

범위가 지정된 GlideElement API는 필드와 해당 값을 처리하기 위한 여러 가지 편리한 스크립트 메서드를 제공합니다. 범위가 지정된 GlideElement 메서드는 현재 Glide 기록의 필드에 사용할 수 있습니다.

## 범위가 지정된 GlideElement - canCreate() {#ariaid-title2}

사용자의 역할이 연결된 필드에 새 항목 작성을 허용하는지 여부를 결정합니다.
{#SGE-canCreate__table_hq2_gmp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 1. 매개변수]

{#SGE-canCreate__table_hq2_gmp_fz} {#SGE-canCreate__table_iq2_gmp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 현재 사용자에게 연결된 필드에 새 항목을 작성할 수 있는 권한이 있는지 여부를 나타내는 플래그입니다. 가능한 값: * true: 사용자가 새 항목을 생성할 수 있습니다. * false: 사용자가 새 항목을 생성할 수 없습니다. {#SGE-canCreate__ul_w1j_ggm_vrb} |
[표 2. 반환]

{#SGE-canCreate__table_iq2_gmp_fz}  
다음 예에서는 사용자에게 문제 \[problem\] 테이블의 최근 기록 3개에 대한 항목을 만들 수 있는 권한이 있는지 확인하는 방법을 보여 줍니다.

    var gr = new GlideRecord('problem');

    // Get records in new state in Problem Table
    gr.addQuery('state','101');

    // Sort records in order of recent to earlier Created Date
    gr.orderByDesc('sys_created_on');

    // Limit the query to three records
    gr.setLimit(3); 
    gr.query();

    while(gr.next()){
      if(gr.short_description.canCreate()){ ///check to see if the current user is allowed to create the record
      gs.info("I can create new records for the field Problem statement for - " + gr.number);
      }
    }

출력:

    I can create new records for the field Problem statement for - PRB0000004
    I can create new records for the field Problem statement for - PRB0001000
    I can create new records for the field Problem statement for - PRB0001001

### 범위가 지정된 등가 {#SGE-canCreate__section_k21_xyr_mcb}

범위가 지정된 애플리케이션에서 canCreate() 메서드를 사용하려면 해당 범위 지정 메서드인 [canCreate()](https://servicenow-prod.fluidtopics.net/9pq9s8okV8LgLe~0OkyL9Q#SGE-canCreate "사용자의 역할이 연결된 필드에 새 항목 작성을 허용하는지 여부를 결정합니다.")를 사용합니다.

## 범위가 지정된 GlideElement - canRead() {#ariaid-title3}

사용자의 역할이 연결된 GlideRecord를 읽을 수 있도록 허용하는지 여부를 나타냅니다.
{#SGE-canRead__table_wdj_mnp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 3. 매개변수]

{#SGE-canRead__table_wdj_mnp_fz} {#SGE-canRead__table_xdj_mnp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 필드를 읽을 수 있으면 True, 그렇지 않으면 False입니다. |
[표 4. 반환]

{#SGE-canRead__table_xdj_mnp_fz}  
다음 예는 읽을 수 있는 간단한 설명 필드가 있는 활성 인시던트 기록 목록을 가져오는 방법을 보여줍니다.

    var grIncident = new GlideRecord('incident');
    grIncident.addEncodedQuery("active=true"); //Query the Incident table for active incidents
    grIncident.orderByDesc('number');
    grIncident.setLimit(3); // limit to three results for example
    grIncident.query();

    while (grIncident.next()) {
        if (grIncident.short_description.canRead()) { //check to see if the current user is allowed to read the record
            gs.info('You have permission to read the short description of: ' + grIncident.number + ' ' + grIncident.short_description);
        }
    }

출력:

    *** Script: You have permission to read the short description of: INC0009009 Unable to access the shared folder.
    *** Script: You have permission to read the short description of: INC0009005 Email server is down.
    *** Script: You have permission to read the short description of: INC0009001 Unable to post content on a Wiki page

## 범위가 지정된 GlideElement - canWrite() {#ariaid-title4}

사용자의 역할이 연결된 GlideRecord에 쓸 수 있도록 허용하는지 여부를 결정합니다.
{#SGE-canWrite__table_myz_1pp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 5. 매개변수]

{#SGE-canWrite__table_myz_1pp_fz} {#SGE-canWrite__table_nyz_1pp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 사용자가 필드에 쓸 수 있으면 True, 그렇지 않으면 False입니다. |
[표 6. 반환]

{#SGE-canWrite__table_nyz_1pp_fz}  
다음 예는 쓰기 가능한 간단한 설명 필드가 있는 활성 인시던트 기록의 목록을 가져오는 방법을 보여줍니다.

    var grIncident = new GlideRecord('incident');
    grIncident.addEncodedQuery("active=true"); //Query the Incident table for active incidents
    grIncident.orderByDesc('number');
    grIncident.setLimit(3); // limit to three results for example
    grIncident.query();

    while (grIncident.next()) {
        if (grIncident.short_description.canWrite()) { //check to see if the current user is allowed to write to the record
            gs.info('You have permission to write to the short description of: ' + grIncident.number + ' ' + grIncident.short_description);
        }
    }

출력:

    *** Script: You have permission to write to the short description of: INC0009009 Unable to access the shared folder.
    *** Script: You have permission to write to the short description of: INC0009005 Email server is down.
    *** Script: You have permission to write to the short description of: INC0009001 Unable to post content on a Wiki page

## 범위가 지정된 GlideElement - changes() {#ariaid-title5}

현재 필드가 수정되었는지 여부를 결정합니다. 이 기능은 저널 필드를 제외하고 사용 가능한 모든 데이터 유형에 사용할 수 있습니다.
주:  
changes() 메서드는 ACL 스크립트 내에서 지원되지 않습니다.  
주:  
이 메서드를 수행하는 GlideRecord를 초기화하고 읽기만 하고 쓰지 않은 경우 기본 이전 및 이후 값이 동일합니다. 이 경우 메서드는 데이터 저장소가 변경되지 않았으므로 "false"를 반환합니다.
{#r_ScopedGlideElementChanges__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 7. 매개변수]

{#r_ScopedGlideElementChanges__table_vy2_525_jq} {#r_ScopedGlideElementChanges__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 필드가 변경되었다면 True, 변경되지 않았다면 False입니다. |
[표 8. 반환]

{#r_ScopedGlideElementChanges__table_qpt_3f5_jq}  
비즈니스 규칙의 다음 예는 assigned_to 필드의 값이 변경되는 경우 EventQueue에서 이벤트를 생성하는 방법을 보여줍니다.

    if (!current.assigned_to.nil() && current.assigned_to.changes()) {
      gs.eventQueue('incident.assigned', current, current.assigned_to.getDisplayValue(), previous.assigned_to.getDisplayValue());
    }

## 범위가 지정된 GlideElement - changesFrom(객체 o) {#ariaid-title6}

현재 필드의 이전 값이 지정된 객체와 일치하는지 여부를 결정합니다.
주:  
이 메서드를 수행하는 GlideRecord를 초기화하고 읽기만 하고 쓰지 않은 경우 기본 이전 및 이후 값이 동일합니다. 이 경우 메서드는 데이터 저장소가 변경되지 않았으므로 "false"를 반환합니다.
{#r_ScopedGlideElementChangesFrom_Object_o__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| o | 객체 | 현재 필드의 이전 값과 비교할 객체 값입니다. |
[표 9. 매개변수]

{#r_ScopedGlideElementChangesFrom_Object_o__table_vy2_525_jq} {#r_ScopedGlideElementChangesFrom_Object_o__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 이전 값이 일치하면 True, 일치하지 않으면 False입니다. |
[표 10. 반환]

{#r_ScopedGlideElementChangesFrom_Object_o__table_qpt_3f5_jq}  

    // The following example shows that in a business rule, if "active" field is changed from true, 
    // insert a event in the EventQueue.
    if (current.active.changesFrom(true)) {
      gs.eventQueue("incident.inactive", current, current.incident_state, previous.incident_state);
    }

## 범위가 지정된 GlideElement - changesTo(객체 o) {#ariaid-title7}

변경 후 필드의 새 값이 지정된 객체와 일치하는지 여부를 결정합니다.
주:  
changesTo() 메서드는 ACL 스크립트 내에서 지원되지 않습니다.  
주:  
이 메서드를 수행하는 GlideRecord를 초기화하고 읽기만 하고 쓰지 않은 경우 기본 이전 및 이후 값이 동일합니다. 이 경우 메서드는 데이터 저장소가 변경되지 않았으므로 "false"를 반환합니다.
{#r_ScopedGlideElementChangesTo_Object_o__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| o | 객체 | 현재 필드의 새 값에 대해 확인할 객체 값입니다. |
[표 11. 매개변수]

{#r_ScopedGlideElementChangesTo_Object_o__table_vy2_525_jq} {#r_ScopedGlideElementChangesTo_Object_o__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 이전 값이 일치하면 True, 일치하지 않으면 False입니다. |
[표 12. 반환]

{#r_ScopedGlideElementChangesTo_Object_o__table_qpt_3f5_jq}  

    // The following example shows that in a business rule, if "active" field is changed to false, 
    // insert a event in the EventQueue.
    if (current.active.changesTo(false)) {
      gs.eventQueue("incident.inactive", current, current.incident_state, previous.incident_state);
    }

## 범위 지정된 GlideElement - dateNumericValue() {#ariaid-title8}

기간 필드에 대해 1970년 1월 1일 00:00:00 GMT 이후의 시간(밀리초)을 반환합니다. 기간 필드가 이미 GlideDateTime 객체이므로 GlideDateTime 객체를 생성할 필요가 없습니다.
{#SGE-dateNumericValue__table_wzd_zlp_j2b__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 13. 매개변수]

{#SGE-dateNumericValue__table_wzd_zlp_j2b} {#SGE-dateNumericValue__table_xzd_zlp_j2b__entry__2}

| 유형 | 설명 |
|-|-|
| 번호 | 1970년 1월 1일 00:00:00 GMT 이후의 시간(밀리초)입니다. |
[표 14. 반환]

{#SGE-dateNumericValue__table_xzd_zlp_j2b}  

    var inc = new GlideRecord('incident');
    inc.get('17c90efb13418700cc36b1422244b05d');
    gs.info(inc.calendar_duration.dateNumericValue());

출력:

    98000

## 범위 지정된 GlideElement - getAttribute(String attributeName) {#ariaid-title9}

딕셔너리에서 지정된 속성의 값을 반환합니다.
속성이 부울 속성인 경우 getBooleanAttribute(String) 를 사용하여 값을 문자열이 아닌 부울로 가져옵니다.
{#SGE-getAttribute_String__table_dsj_hqp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| attributeName | 문자열 | 특성 이름 |
[표 15. 매개변수]

{#SGE-getAttribute_String__table_dsj_hqp_fz} {#SGE-getAttribute_String__table_esj_hqp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 속성 값 |
[표 16. 반환]

{#SGE-getAttribute_String__table_esj_hqp_fz}  

    doit();
    function doit() {
      var now_GR = new GlideRecord('sys_user');
      now_GR.query("user_name","admin");
      if (now_GR.next()) {
        gs.info("we got one");
        gs.info(now_GR.location.getAttribute("tree_picker"));
      }
    }

## 범위 지정된 GlideElement - getBooleanAttribute(문자열 attributeName) {#ariaid-title10}

딕셔너리에서 지정된 속성의 부울 값을 반환합니다.
값을 문자열로 가져오려면 getAttribute(string)를 사용합니다.
{#SGE-getBooleanAttribute_String__table_fv5_prp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| attributeName | 문자열 | 특성 이름 |
[표 17. 매개변수]

{#SGE-getBooleanAttribute_String__table_fv5_prp_fz} {#SGE-getBooleanAttribute_String__table_gv5_prp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 속성의 부울 값입니다. 속성이 없으면 false를 반환합니다. |
[표 18. 반환]

{#SGE-getBooleanAttribute_String__table_gv5_prp_fz}  
다음 예제에서는 두 필드에 대한 특성의 ignore_filter_on_new 부울 값을 가져오는 방법을 보여 줍니다.

    var inc = new GlideRecord('incident');
    inc.query();

    if (inc.next())
     {
       // opened_by field has attribute "ignore_filter_on_new = true"
       gs.info(inc.opened_by.getBooleanAttribute("ignore_filter_on_new"));

      // short_description field does not have attribute ignore_filter_on_new
       gs.info(inc.short_description.getBooleanAttribute("ignore_filter_on_new"));
     }

출력:

    true
    false

## 범위 지정된 GlideElement - getChoices(문자열에 따라 다름) {#ariaid-title11}

지정된 필드에 대한 선택 목록을 반환합니다.
선택 목록을 반환할 필드는 메서드 호출에 지정됩니다. 예: `var choices = glideRecord.urgency.getChoices();`. 선택 목록 필드 유형 및 관련 기능에 대한 자세한 내용은 [선택 목록 필드 유형을](https://www.servicenow.com/docs/access?context=c_ChoiceLists&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US) 참조하십시오.
{#r_ScopedGlideElementGetChoices_String_dependent__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 종속의 | 문자열 | 옵션입니다. 선택 목록 필드가 종속된 관련 기록 내의 필드입니다. |
[표 19. 매개변수]

{#r_ScopedGlideElementGetChoices_String_dependent__table_vy2_525_jq} {#r_ScopedGlideElementGetChoices_String_dependent__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| 배열 | 선택 목록에 사용할 수 있는 값의 목록으로, 선택 \[sys_choice\] 테이블의 값입니다. 매개변수가 dependent 전달되면 반환 결과에는 지정된 종속 필드에 사용할 수 있는 선택 사항만 반영됩니다. |
[표 20. 반환]

{#r_ScopedGlideElementGetChoices_String_dependent__table_qpt_3f5_jq}  

    var glideRecord = new GlideRecord('incident'); 
    glideRecord.query('priority','1'); 
    glideRecord.next(); 
     
    // urgency has choice list: 1 - High, 2 - Medium, 3 - Low, with value: 1, 2, 3
    var choices = glideRecord.urgency.getChoices();

## 범위 지정 GlideElement - getChoiceValue() {#ariaid-title12}

현재 선택 항목에 대한 선택 레이블을 반환합니다.
선택 항목에는 값(숫자)과 레이블(문자열)이 있습니다. 이 메서드는 레이블을 반환합니다.
{#r_ScopedGlideElementGetChoiceValue__table_kgb_3z3_ps__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 21. 매개변수]

{#r_ScopedGlideElementGetChoiceValue__table_kgb_3z3_ps} {#r_ScopedGlideElementGetChoiceValue__table_lgb_3z3_ps__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 선택한 선택 사항의 레이블입니다. |
[표 22. 반환]

{#r_ScopedGlideElementGetChoiceValue__table_lgb_3z3_ps}  

    var glideRecord = new GlideRecord('incident'); 
    glideRecord.query('priority','1'); 
    glideRecord.next(); 
     
    // urgency has choice list: 1 - High, 2 - Medium, 3 - Low, with value: 1, 2, 3
    var choiceLabel = glideRecord.urgency.getChoiceValue(); 
    gs.info(choiceLabel);

출력:

    1 - High

## 범위 지정된 GlideElement - getDecryptedValue() {#ariaid-title13}

범위가 지정된 애플리케이션의 암호(2단계 암호화) 필드에 대한 일반 텍스트 값을 반환합니다.
{#SGE-getDecryptedValue__table_xd2_gsp_jz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 23. 매개변수]

{#SGE-getDecryptedValue__table_xd2_gsp_jz} {#SGE-getDecryptedValue__table_yd2_gsp_jz__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 일반 텍스트 암호입니다. |
[표 24. 반환]

{#SGE-getDecryptedValue__table_yd2_gsp_jz}  

    var tablename = 'x_scoped_app_table'
    var CI = new GlideRecord(tablename);  
    CI.addQuery('number', '0001002'); 
    CI.query(); 
    CI.next(); 

    var password = CI.password_field
    var decrypted = password.getDecryptedValue(); 
    gs.info(decrypted);

출력:

    x_scoped_app: cleartextpassword

## 범위 지정된 GlideElement - getDisplayValue(최대 문자 수) {#ariaid-title14}

연결된 GlideRecord 객체에서 지정된 필드의 서식이 지정된 표시 값을 반환합니다.
표시 값은 데이터베이스의 실제 값과 사용자 또는 시스템 설정 및 기본 설정에 따라 조작됩니다.  
반환되는 표시 값은 필드 유형에 따라 다릅니다.

* 선택 필드: 데이터베이스 값은 숫자일 수 있지만 표시 값은 더 설명적입니다.
* 날짜 필드: 데이터베이스 값은 UTC 형식이고 표시 값은 사용자의 시간대를 기반으로 합니다.
* 암호화된 텍스트: 데이터베이스 값은 암호화되지만 표시된 값은 사용자의 암호화 컨텍스트에 따라 암호화되지 않습니다.
* 참조 필드: 데이터베이스 값은 sys_id이지만 표시 값은 참조된 기록의 표시 필드입니다.
{#r_ScopedGlideElementGetDisplayValue_Number_maxCharacters__ul_ok1_cbv_hsb}

표시 값에 대한 자세한 내용은 [표시 값을](https://www.servicenow.com/docs/access?context=c_DisplayValues&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US) 참조하십시오.
{#r_ScopedGlideElementGetDisplayValue_Number_maxCharacters__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| maxCharacters (영문) | 번호 | 옵션입니다. 원하는 최대 문자 수입니다. 기본값: 모두 |
[표 25. 매개변수]

{#r_ScopedGlideElementGetDisplayValue_Number_maxCharacters__table_vy2_525_jq} {#r_ScopedGlideElementGetDisplayValue_Number_maxCharacters__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 지정된 필드의 값을 표시합니다. |
[표 26. 반환]

{#r_ScopedGlideElementGetDisplayValue_Number_maxCharacters__table_qpt_3f5_jq}  
다음 예는 인시던트 기록에서 우선순위 필드의 표시 값을 검색하는 방법을 보여줍니다.

    var glideRecord = new GlideRecord('incident');
    glideRecord.query('priority','1');
    glideRecord.next();
    gs.info(glideRecord.priority.getDisplayValue());

출력:

    1 - Critical

다음 예에서는 인시던트 데이터베이스에서 지정된 필드의 표시 값과 내부 값을 모두 검색하는 방법을 보여 줍니다.

    var now_GR = new GlideRecord('incident');
    now_GR.get('9c573169c611228700193229fff72400'); //INC0000001
    gs.info('Display Values:');
    gs.info('Opened at ' + now_GR.opened_at.getDisplayValue());
    gs.info('Opened by ' + now_GR.opened_by.getDisplayValue());
    gs.info('Priority ' + now_GR.priority.getDisplayValue());
    gs.info('Values:');
    gs.info('Opened at ' + now_GR.opened_at.getValue());
    gs.info('Opened by ' + now_GR.opened_by.getValue());
    gs.info('Priority ' + now_GR.priority.getValue());

출력:

    Display Values:
    Opened at 2022-02-01 15:09:51
    Opened by Joe Employee
    Priority 1 - Critical
    Values:
    Opened at 2022-02-01 23:09:51
    Opened by 681ccaf9c0a8016400b98a06818d57c7
    Priority 1

## 범위 지정된 GlideElement - getDisplayValueLang(문자열 언어) {#ariaid-title15}

매개변수로 전달된 언어로 된 필드의 표시 값을 가져옵니다.
결과는 선택 사항, 번역된 필드 및 번역된 텍스트와 같은 번역 가능한 필드 유형에만 적용할 수 있습니다. 다른 필드 유형의 경우 결과는 기본적으로 [getDisplayValue()](https://servicenow-prod.fluidtopics.net/9pq9s8okV8LgLe~0OkyL9Q#r_ScopedGlideElementGetDisplayValue_Number_maxCharacters "연결된 GlideRecord 객체에서 지정된 필드의 서식이 지정된 표시 값을 반환합니다.")로 설정됩니다.

번역된 값을 검색하려면 해당 언어 플러그인이 있어야 합니다. 자세한 내용은 [Activate a language](https://www.servicenow.com/docs/access?context=t_ActivateALanguage&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US) 문서를 참조하십시오.{#SGE-getDisplayValueLang_S__p_SGE-getDspOrLabellLang-plugins}

[범위 지정된 GlideElement - getLabelLang(문자열 언어)](https://servicenow-prod.fluidtopics.net/9pq9s8okV8LgLe~0OkyL9Q#SGE-getLabelLang_S "매개변수로 전달된 언어로 된 필드의 레이블 값을 가져옵니다.") 또한 참조하십시오.
{#SGE-getDisplayValueLang_S__table_GE-language-parm__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 언어 | 문자열 | IETF BCP-47을 준수하는 언어 태그입니다. |
[표 27. 매개변수]

{#SGE-getDisplayValueLang_S__table_GE-language-parm} {#SGE-getDisplayValueLang_S__table_qpt_3f5_jq__entry__2}{#SGE-getDisplayValueLang_S__ph_getDisOrLblLang_returns_if}

| 유형 | 설명 |
|-|-|
| 문자열 | 전달된 언어로 된 필드의 값을 표시합니다. 번역을 사용할 수 없는 경우 메서드는 현재 사용자의 언어로 번역된 값을 검색합니다. 번역을 사용할 수 없는 경우 결과는 기본적으로 영어로 설정됩니다. |
[표 28. 반환]

{#SGE-getDisplayValueLang_S__table_qpt_3f5_jq}  
다음 예제에서는 수락 (UI 보기) 제목 필드에서 원본 텍스트와 독일어로 번역된 텍스트를 가져오는 방법을 보여 줍니다.

    var uiView = new GlideRecord("sys_ui_view");
    uiView.get("fa776f6d97700100f309124eda2975bc");

    gs.info("getDisplayValue: " + uiView.getElement("title").getDisplayValue());
    gs.info("getDisplayValueLang: " + uiView.getElement("title").getDisplayValueLang("de"));

출력:

    getDisplayValue: Accept
    getDisplayValueLang: Akzeptieren

## 범위가 지정된 GlideElement - getED() {#ariaid-title16}

필드의 요소 설명자를 반환합니다.
{#r_ScopedGlideElementGetED__table_k23_ps3_yr__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 29. 매개변수]

{#r_ScopedGlideElementGetED__table_k23_ps3_yr} {#r_ScopedGlideElementGetED__table_l23_ps3_yr__entry__2}

| 유형 | 설명 |
|-|-|
| GlideElementDescriptor (영문) | 필드의 요소 설명자입니다. |
[표 30. 반환]

{#r_ScopedGlideElementGetED__table_l23_ps3_yr}  

    var grInc = new GlideRecord('incident');
    grInc.query('priority', '1');
     
    var field = grInc.getElement('priority');
    var ed = field.getED();

## 범위가 지정된 GlideElement - getGlobalDisplayValue() {#ariaid-title17}

전화 번호를 국제 형식으로 반환합니다.
{#r_SGE-getGlobalDisplayValue__table_nfm_lq2_bx__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 31. 매개변수]

{#r_SGE-getGlobalDisplayValue__table_nfm_lq2_bx} {#r_SGE-getGlobalDisplayValue__table_ofm_lq2_bx__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 국제 형식의 전화 번호입니다. |
[표 32. 반환]

{#r_SGE-getGlobalDisplayValue__table_ofm_lq2_bx}  
다음 예는 워크업 위치의 전화 번호를 가져오는 방법을 보여줍니다. 이 예시를 진행하려면 플러그인이 워크업 경험 필요합니다.

    // Passing walkup location name and closed phone number in parameters
    setWalkupLocPhone('Santa Clara Tech Lounge','phone_number');

    function setWalkupLocPhone(locName, field) {
      var walkupLoc = new GlideRecord('wu_location_queue');
      walkupLoc.addQuery('name',locName);
      walkupLoc.query();
      walkupLoc.next();

      // Returns the phone number of walk-up location queue in international format
      gs.info(walkupLoc[field].getGlobalDisplayValue());
    }

출력:

    +91 98124 56789

## 범위 지정된 GlideElement - getHTMLValue(최대 문자 수) {#ariaid-title18}

필드의 HTML 값을 반환합니다.
{#SGE-getHTMLValue_Number__table_p1h_2tp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| maxChars | 번호 | 옵션입니다. 반환할 최대 문자 수입니다. |
[표 33. 매개변수]

{#SGE-getHTMLValue_Number__table_p1h_2tp_fz} {#SGE-getHTMLValue_Number__table_q1h_2tp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 필드의 HTML 값입니다. |
[표 34. 반환]

{#SGE-getHTMLValue_Number__table_q1h_2tp_fz}  

    var inccause = new GlideRecord("incident");
    inccause.short_description = current.short_description;
    inccause.comments = current.comments.getHTMLValue();
    inccause.insert();

## 범위가 지정된 GlideElement - getJournalEntry(가장 최근 번호) {#ariaid-title19}

가장 최근 저널 항목 또는 모든 저널 항목을 리턴합니다.
{#SGE-getJournalEntry_N__table_lpt_2wp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 가장 최근 | 번호 | 1이면 가장 최근 항목을 반환합니다. -1이면 모든 저널 항목을 리턴합니다. |
[표 35. 매개변수]

{#SGE-getJournalEntry_N__table_lpt_2wp_fz} {#SGE-getJournalEntry_N__table_mpt_2wp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 가장 최근 항목의 경우, 저널 항목의 필드 레이블, 시간소인 및 사용자 표시 이름을 포함하는 문자열을 리턴합니다. 모든 저널 항목의 경우, 각 항목이 "\\n\\n"으로 구분된 단일 문자열로 입력된 모든 저널 항목에 대해 동일한 정보를 리턴합니다. |
[표 36. 반환]

{#SGE-getJournalEntry_N__table_mpt_2wp_fz}  

    //gets all journal entries as a string where each entry is delimited by '\n\n'
    var notes = current.work_notes.getJournalEntry(-1); 
    //stores each entry into an array of strings
    var na = notes.split("\n\n");  
                          
    for (var i = 0; i < na.length; i++)                 
      gs.info(na[i]);

## 범위가 지정된 GlideElement - getLabel() {#ariaid-title20}

개체 레이블을 반환합니다.
{#SGE-getLabel__table_tlw_sxp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 37. 매개변수]

{#SGE-getLabel__table_tlw_sxp_fz} {#SGE-getLabel__table_ulw_sxp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 객체 레이블 |
[표 38. 반환]

{#SGE-getLabel__table_ulw_sxp_fz}  

    var now_GR = new GlideRecord("sc_req_item");
    now_GR.addQuery("request", current.sysapproval);
    now_GR.query();
    while(now_GR.next()) {
    var nicePrice = now_GR.price.toString();
        if (nicePrice != ) {
            nicePrice = parseFloat(nicePrice);
            nicePrice = nicePrice.toFixed(2);
        }
        template.print(now_GR.number + ":  " + now_GR.quantity + " X " + now_GR.cat_item.getDisplayValue() + " at $" + nicePrice + " each \n");
        template.print("    Options:\n");
        var variables = now_GR.variables.getElements();    
        for (var key in variables) {
          var now_V = variables[key];
          if(now_V.getQuestion().getLabel() != ) {
             template.space(4);
             template.print('     ' +  now_V.getQuestion().getLabel() + " = " + now_V.getDisplayValue() + "\n");  
          }
        }
    }

## 범위 지정된 GlideElement - getLabelLang(문자열 언어) {#ariaid-title21}

매개변수로 전달된 언어로 된 필드의 레이블 값을 가져옵니다.
번역된 값을 검색하려면 해당 언어 플러그인이 있어야 합니다. 자세한 내용은 [Activate a language](https://www.servicenow.com/docs/access?context=t_ActivateALanguage&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US) 문서를 참조하십시오.  
참고 항목:

* [getDisplayValueLang()을 호출합니다.](https://servicenow-prod.fluidtopics.net/9pq9s8okV8LgLe~0OkyL9Q#SGE-getDisplayValueLang_S "매개변수로 전달된 언어로 된 필드의 표시 값을 가져옵니다.")
* [getLabel()을 호출합니다.](https://servicenow-prod.fluidtopics.net/9pq9s8okV8LgLe~0OkyL9Q#SGE-getLabel "개체 레이블을 반환합니다.")
{#SGE-getLabelLang_S__ul_fw4_b1b_txb}
{#SGE-getLabelLang_S__id_nbn_4c5_sxb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 언어 | 문자열 | IETF BCP-47을 준수하는 언어 태그입니다. |
[표 39. 매개변수]

{#SGE-getLabelLang_S__id_nbn_4c5_sxb} {#SGE-getLabelLang_S__table_ulw_sxp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 전달된 언어의 필드 레이블 값입니다. 번역을 사용할 수 없는 경우 메서드는 현재 사용자의 언어로 번역된 값을 검색합니다. 번역을 사용할 수 없는 경우 결과는 기본적으로 영어로 설정됩니다. |
[표 40. 반환]

{#SGE-getLabelLang_S__table_ulw_sxp_fz}  
다음 예제에서는 원래 레이블 텍스트와 수락 (UI 보기) 제목의 독일어 번역을 가져오는 방법을 보여 줍니다.

    var uiView = new GlideRecord("sys_ui_view");
    uiView.get("fa776f6d97700100f309124eda2975bc");

    gs.info("getLabel: " + uiView.getElement("title").getLabel());
    gs.info("getLabelLang: " + uiView.getElement("title").getLabelLang("de"));

출력:

    getLabel: Title
    getLabelLang: Titel

## 범위가 지정된 GlideElement - getName() {#ariaid-title22}

필드의 이름을 반환합니다.
{#SGE-getName__table_vdn_vyp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 41. 매개변수]

{#SGE-getName__table_vdn_vyp_fz} {#SGE-getName__table_wdn_vyp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 필드 이름입니다. |
[표 42. 반환]

{#SGE-getName__table_wdn_vyp_fz}  
다음 예제에서는 sys_user 레코드의 각 필드에 대한 이름 및 기타 값을 가져오는 방법을 보여 줍니다.

    var userRec = new GlideRecord("sys_user"); // GlideRecord to sys_user table

    userRec.get("5137153cc611227c000bbd1bd8cd2005"); // Sys Id of user: Fred Luddy

    var fields = userRec.getFields();

    for (var i = 0; i < fields.size(); i++) {

        var field = fields.get(i);
        var name = field.getName(); // Name of the field
        var label = field.getLabel(); // Label of the field
        var value = field.getDisplayValue(); // Value of the field

        gs.info((Number(i) + 1) + ".\n" + "Field Label: " + label + "\n" + "Field Name: " + name + "\n" + "Field Value: " + value);

    };

출력. 결과에는 62개의 필드가 포함되며 공간을 절약하기 위해 줄임표(...)로 잘렸습니다.

    *** Script: 1.
    Field Label: Country code
    Field Name: country
    Field Value: 
    *** Script: 2.
    Field Label: Calendar integration
    Field Name: calendar_integration
    Field Value: Outlook
    ...
    *** Script: 47.
    Field Label: First name
    Field Name: first_name
    Field Value: Fred
    ...
    *** Script: 54.
    Field Label: Last name
    Field Name: last_name
    Field Value: Luddy
    ...

## 범위 지정된 GlideElement - getReferenceTable() {#ariaid-title23}

참조 요소의 테이블 이름을 가져옵니다.
{#r_ScopedGlideElementGetReferenceTable__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 43. 매개변수]

{#r_ScopedGlideElementGetReferenceTable__table_vy2_525_jq} {#r_ScopedGlideElementGetReferenceTable__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 참조의 테이블 이름입니다. |
[표 44. 반환]

{#r_ScopedGlideElementGetReferenceTable__table_qpt_3f5_jq}  

    var grINC = new GlideRecord('incident');
    grINC.query('number','INC0010041'); // record assignment group assigned to "CAB Approval"
    if (grINC.next()) { 
      // Get the table name 
      var tableName = grINC.assignment_group.getReferenceTable();
      gs.info( tableName ); 
    }

## 범위 지정된 GlideElement - getRefRecord() {#ariaid-title24}

지정된 참조 요소에 대한 GlideRecord 객체를 반환합니다.
경고:  
참조 요소에 값이 없으면 NULL 객체가 아닌 빈 GlideRecord 객체를 반환합니다.
{#r_ScopedGlideElementGetRefRecord__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 45. 매개변수]

{#r_ScopedGlideElementGetRefRecord__table_vy2_525_jq} {#r_ScopedGlideElementGetRefRecord__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| GlideRecord | GlideRecord 객체 |
[표 46. 반환]

{#r_ScopedGlideElementGetRefRecord__table_qpt_3f5_jq}  


    var grINC = new GlideRecord('incident'); 
    grINC.addNotNullQuery('caller_id'); 
    grINC.query(); 
    if (grINC.next()) { 

    // Get a GlideRecord object for the referenced sys_user record 
    var grUSER = grINC.caller_id.getRefRecord(); 
    if (grUSER.isValidRecord()) 
      gs.info(grUSER.getValue('name')); 

    } 

## 범위가 지정된 GlideElement - getTableName() {#ariaid-title25}

필드가 있는 테이블의 이름을 반환합니다.
{#SGE-getTableName__table_gfq_szp_fz__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 47. 매개변수]

{#SGE-getTableName__table_gfq_szp_fz} {#SGE-getTableName__table_hfq_szp_fz__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 테이블의 이름입니다. 반환된 값은 기록이 들어 있는 클래스 테이블과 다를 수 있습니다. 제품 설명서에서 테이블 및 클래스를 참조하십시오. |
[표 48. 반환]

{#SGE-getTableName__table_hfq_szp_fz}  

    if (current.approver.getTableName() == "sysapproval_approver") {
      if (current.approver == email.from_sys_id)  {
         current.comments = "reply from: " + email.from + "\n\n" + email.body_text;
     
       // if it's been cancelled, it's cancelled.
      var doit = true;
      if (current.state=='cancelled')
          doit = false;
     
      if (email.body.state != undefined)
         current.state= email.body.state;
     
       if (doit)
          current.update();
    } else {
       gs.log("Approval for task ("+current.sysapproval.getDisplayValue()+") rejected because user sending 
               email( "+email.from+") does not match the approver ("+current.approver.getDisplayValue()+")");
    }
     
    }

## 범위 지정된 GlideElement - nil() {#ariaid-title26}

필드가 null인지 여부를 결정합니다.
{#r_ScopedGlideElementNil__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 49. 매개변수]

{#r_ScopedGlideElementNil__table_vy2_525_jq} {#r_ScopedGlideElementNil__table_bdf_zfr_2r__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 필드가 null인지 여부를 나타내는 플래그입니다. 가능한 값: * true: 필드가 null입니다. * false: 필드가 null이 아닙니다. {#r_ScopedGlideElementNil__ul_lhk_bzp_krb} |
[표 50. 반환]

{#r_ScopedGlideElementNil__table_bdf_zfr_2r}  

    var glideRecord = new GlideRecord('incident'); 
    glideRecord.query('priority','1'); 
    glideRecord.next(); 
    gs.info(glideRecord.state.nil());

출력:

    false

## 범위 지정된 GlideElement - setDateNumericValue(밀리초 수) {#ariaid-title27}

날짜/시간 요소의 값을 1970년 1월 1일 00:00:00 GMT 이후의 지정된 시간(밀리초)으로 설정합니다.
호출되면 setDateNumericValue()는 자동으로 필요한 GlideDateTime/GlideDate/GlideDuration 객체를 만든 다음 요소를 지정된 값으로 설정합니다.  
주:  
이 메서드를 호출하기 전에 기존 레코드를 쿼리하거나 now_GR.initialize() 메서드를 사용하여 새 레코드를 초기화하여 요소가 이미 존재해야 합니다.
{#SGE-setDateNumericValue_N__table_hqp_hfd_1z__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 밀리초 | 번호 | 1970년 1월 1일 이후 경과한 시간(밀리초) |
[표 51. 매개변수]

{#SGE-setDateNumericValue_N__table_hqp_hfd_1z} {#SGE-setDateNumericValue_N__table_iqp_hfd_1z__entry__2}

| 유형 | 설명 |
|-|-|
| void |   |
[표 52. 반환]

{#SGE-setDateNumericValue_N__table_iqp_hfd_1z}  

    var now_GR = new GlideRecord("incident");
    now_GR.initialize();
    now_GR.opened_at.setDateNumericValue(10000);

## 범위 지정된 GlideElement - setDisplayValue(객체 값) {#ariaid-title28}

필드의 표시 값을 설정합니다.
{#r_ScopedGlideElementSetDisplayValue_Object_value__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 값 | 객체 | 필드에 대해 설정할 값입니다. |
[표 53. 매개변수]

{#r_ScopedGlideElementSetDisplayValue_Object_value__table_vy2_525_jq} {#r_ScopedGlideElementSetDisplayValue_Object_value__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| void |   |
[표 54. 반환]

{#r_ScopedGlideElementSetDisplayValue_Object_value__table_qpt_3f5_jq}  

    var glideRecord = new GlideRecord('incident'); 
    glideRecord.query('priority','1'); 
    glideRecord.next();
     
    //change the urgency to 3 
    glideRecord.urgency.setDisplayValue('3 - Low');
    gs.info(glideRecord.urgency);

## 범위 지정된 GlideElement - setError(String errorMessage) {#ariaid-title29}

오류 메시지를 추가합니다. Fuji 패치 3에서 사용할 수 있습니다.
{#r_ScopedGlideElementSetError_String__table_ix3_q5t_vr__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| errorMessage | 문자열 | 오류 메시지입니다. |
[표 55. 매개변수]

{#r_ScopedGlideElementSetError_String__table_ix3_q5t_vr} {#r_ScopedGlideElementSetError_String__table_jx3_q5t_vr__entry__2}

| 유형 | 설명 |
|-|-|
| void |   |
[표 56. 반환]

{#r_ScopedGlideElementSetError_String__table_jx3_q5t_vr}  

    var glideRecord = new GlideRecord('incident');
    glideRecord.query('priority','1');
    glideRecord.next();
     
    glideRecord.short_description.setError('Error text');

## 범위 지정된 GlideElement - setPhoneNumber(Object phoneNumber, Boolean strict) {#ariaid-title30}

필드를 지정된 전화 번호로 설정합니다.
이 메서드는 전화 번호 GlideElement에서만 사용할 수 있습니다.
{#r_SGE-setPhoneNumber_O_B__table_exy_3m2_bx__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| phoneNumber | 객체 | 설정할 전화 번호입니다. 이는 국제 또는 로컬 형식일 수 있습니다. |
| 엄격한 | 부울 | true일 때는 지정된 숫자가 올바른 형식과 일치해야 함을 지정합니다. false인 경우 시스템은 잘못된 형식의 전화 번호를 수정하려고 시도합니다. |
[표 57. 매개변수]

{#r_SGE-setPhoneNumber_O_B__table_exy_3m2_bx} {#r_SGE-setPhoneNumber_O_B__table_fxy_3m2_bx__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 전화 번호 값이 설정되었는지 여부를 나타내는 플래그입니다. 가능한 값: * true: 값이 설정되었습니다. * false: 값이 설정되지 않았습니다. {#r_SGE-setPhoneNumber_O_B__ul_zts_mzp_krb} |
[표 58. 반환]

{#r_SGE-setPhoneNumber_O_B__table_fxy_3m2_bx}  
다음 예는 워크업 위치의 전화 번호를 설정하는 방법을 보여줍니다. 이 예시를 진행하려면 플러그인이 워크업 경험 필요합니다.

    setWalkupLocPhone('Santa Clara Tech Lounge','+91 9812456789'); 

    function setWalkupLocPhone(locName, phoneNumber) {
      var walkupLoc = new GlideRecord('wu_location_queue');
      walkupLoc.addQuery('name', locName);
      walkupLoc.query();
      walkupLoc.next();
      
      // Set phone number of walk-up location
      var isPhoneNumberSet = walkupLoc.phone_number.setPhoneNumber(phoneNumber, true);
      walkupLoc.update();
      gs.info('Phone Number: ' + walkupLoc.phone_number);
      gs.info('Is phone number specified match the correct format: ' + isPhoneNumberSet);
    }

출력:

    Phone Number: +919812456789
    Is phone number specified match the correct format: true

## 범위 지정된 GlideElement - setValue(객체 값) {#ariaid-title31}

필드의 값을 설정합니다.
주:  
이 메서드를 호출하기 전에 기존 레코드를 쿼리하거나 now_GR.initialize() 메서드를 사용하여 새 레코드를 초기화하여 요소가 이미 존재해야 합니다.
{#r_ScopedGlideElementSetValue_Object_value__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 값 | 객체 | 필드를 설정할 객체 값입니다. |
[표 59. 매개변수]

{#r_ScopedGlideElementSetValue_Object_value__table_vy2_525_jq} {#r_ScopedGlideElementSetValue_Object_value__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| void |   |
[표 60. 반환]

{#r_ScopedGlideElementSetValue_Object_value__table_qpt_3f5_jq}  
문자열을 전달하는 값을 설정합니다.

    var glideRecord = new GlideRecord('incident');
    glideRecord.query('priority','1');
    glideRecord.next();
    glideRecord.short_description.setValue('Network failure');

개체를 전달하는 값을 설정합니다.

    var now_GR  = new GlideRecord('student');
    now_GR.initialize();
    now_GR.setValue('first_name', 'Joe');
    now_GR.setValue('last_name', 'Smith');
    now_GR.insert();

## 범위 지정된 GlideElement - toString() {#ariaid-title32}

GlideRecord 필드의 값을 문자열로 변환합니다.
{#r_ScopedGlideElementToString__table_vy2_525_jq__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 없음 |   |   |
[표 61. 매개변수]

{#r_ScopedGlideElementToString__table_vy2_525_jq} {#r_ScopedGlideElementToString__table_qpt_3f5_jq__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 문자열로 표시되는 값입니다. |
[표 62. 반환]

{#r_ScopedGlideElementToString__table_qpt_3f5_jq}  

    var glideRecord = new GlideRecord('incident');
    glideRecord.query('priority','1');
    glideRecord.next();
    gs.info(glideRecord.opened_at.toString());

출력:

    2019-08-31 23:09:51


