Glide 修正スクリプトを実行して既存のデータを移行する

  • リリースバージョン: Yokohama
  • 更新日 2025年01月30日
  • 所要時間:3分
  • インスタンスを Washington DC から Yokohama リリースに更新する場合は、Glide 修正を手動で実行して、請求書テーブルと請求書明細テーブルをそれぞれのベーステーブルに更新する必要があります。

    始める前に

    必要なロール:maint

    手順

    1. 次のように移動する。 All (すべて) > システム定義 > 修正スクリプト.
    2. [New (新規)] を選択します。
      新しい修正スクリプトレコードが開きます。
    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. [Submit (送信)] を選択します。
      修正スクリプトが作成されます。
    10. [Run Fix Script] を選択します。
      親の請求書テーブルと請求書明細テーブルがそれぞれのベーステーブルに変更されます。