Glide 수정 스크립트를 실행하여 기존 데이터 마이그레이션
인스턴스를 릴리스에서 Washington DC 릴리스로 Xanadu 업데이트할 때 Glide 수정을 수동으로 실행하여 송장 및 송장 라인 테이블을 각각의 기본 테이블로 업데이트해야 합니다.
시작하기 전에
필요한 역할: admin
프로시저
- 다음으로 이동 모두 > 시스템 정의 > 스크립트 수정.
-
새로 만들기를 선택합니다.
새 수정 스크립트 기록이 열립니다.
- 수정 스크립트 기록을 엽니다.
- 이름을 상위 재송장 테이블로 입력합니다.
- 롤백 기록 확인란의 선택을 취소합니다.
-
스크립트 필드에서 송장 라인에 대해 다음 코드를 추가합니다.
(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); } })(); -
스크립트 필드에서 송장에 대한 다음 코드를 추가합니다.
(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); } })(); - 저장을 선택합니다.
-
제출을 선택합니다.
수정 스크립트가 생성됩니다.
-
수정 스크립트 실행을 선택합니다.
상위 송장 및 송장 라인 테이블이 각각의 기본 테이블로 변경됩니다.