Glide 수정 스크립트를 실행하여 기존 데이터 마이그레이션

  • 릴리스 버전: Zurich
  • 업데이트 날짜 2025년 07월 31일
  • 소요 시간: 3분
  • 인스턴스를 Washington DC 릴리스에서 릴리스로 Zurich 업데이트할 때 Glide 수정을 수동으로 실행하여 송장 및 송장 라인 테이블을 각각의 기본 테이블로 업데이트해야 합니다.

    시작하기 전에

    필요한 역할: maint

    프로시저

    1. 다음으로 이동 모두 > 시스템 정의 > 스크립트 수정.
    2. 새로 만들기를 선택합니다.
      새 수정 스크립트 기록이 열립니다.
    3. 수정 스크립트 기록을 엽니다.
    4. 이름을 상위 송장 재지정 테이블로 입력합니다.
    5. 롤백할 기록 확인란의 선택을 취소합니다.
    6. 스크립트 필드에서 송장 라인에 대해 다음 코드를 추가합니다.
      (function() {
                  const invoiceLinetableToReparent = "sn_shop_invoice_line";
                  const invoiceLineNewExtends = "sn_fin_base_invoice_line";
                  const oldExtends = "";
      var invoiceLineGr = new GlideRecord("sys_db_object");
              invoiceLineGr.get("name", invoiceLinetableToReparent);
              if(invoiceLineGr.super_class.name == invoiceLineNewExtends) {
                  gs.info("{0} table already reparented to {1}. No reparenting required.", invoiceLinetableToReparent, invoiceLineNewExtends);
                  return;
              }
      try {
                  
                  var invoiceLinetpc = new GlideTableParentChange(invoiceLinetableToReparent);
                  var reparentInvoiceLineResult = invoiceLinetpc.change(oldExtends, invoiceLineNewExtends);
      
              } catch (e) {
                  gs.warn("Table parent change for sn_shop_invoice_line did not complete. Error: {0}", e);
              } 
      })();
      
    7. 스크립트 필드에서 송장에 대한 다음 코드를 추가합니다.
       (function() {
              const invoiceTableToReparent = "sn_shop_invoice";
              const oldExtends = "";
              const invoiceNewExtends = "sn_fin_base_invoice";
      var invoiceGr = new GlideRecord("sys_db_object");
              invoiceGr.get("name", invoiceTableToReparent);
              if(invoiceGr.super_class.name == invoiceNewExtends){
                  gs.info("{0} table already reparented to {1}. No reparenting required.", invoiceTableToReparent, invoiceNewExtends);
                  return;
              }
       try {
                  var tpc = new GlideTableParentChange(invoiceTableToReparent);
                  var reparentResult = tpc.change(oldExtends, invoiceNewExtends);
              } catch (e) {
                  gs.warn("Table parent change for sn_shop_invoice did not complete. Error: {0}", e);
              } 
       })();
      
    8. 저장을 선택합니다.
    9. 제출을 선택합니다.
      수정 스크립트가 생성됩니다.
    10. 수정 스크립트 실행을 선택합니다.
      상위 송장 및 송장 라인 테이블이 각각의 기본 테이블로 변경됩니다.