親要求から修正要求にフィールドをコピー

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:3分
  • リンクされた親要求と親契約から契約要求にフィールドを自動的にコピーするように ContractManagementExt 拡張ポイントを構成します。

    このタスクについて

    アドミニストレーターは、契約リポジトリレコードの値が修正要求に自動的にコピーされるフィールドを設定できます。契約履行者が要求された修正に従って更新できるように、契約リポジトリレコードと修正要求の間の共通フィールドを構成します。例:終了日と支払条件を契約リポジトリから利用可能にして自動的にコピーできるように設定した場合、履行者は修正要求の一部としてこれらのフィールドの値を変更できます。

    始める前に

    必要なロール:admin

    手順

    1. 移動先 すべて > システム拡張ポイント > スクリプト化済みの拡張点.
    2. [API 名] フィールドに「sn_cm_core.ContractManagementExt」と入力します。
    3. レコードを選択します。
    4. [関連リンク] セクションで、[実装を作成] を選択します。
    5. [スクリプトインクルード] フォームのフィールドに入力します。

      フィールド値の説明については、「スクリプト拡張ポイントのフォームフィールド」を参照して ください。

    6. [ スクリプト] フィールドで、copyDataFromBUToCMR 関数を更新して、親レコードから契約要求にコピーするフィールドを設定します。
      たとえば、親レコードから契約要求に [ アカウント ] フィールドと [終了日 ] フィールドをコピーする場合は、次のように使用できます。
      
      /**
      	 * @param {GlideRecord} parentRequestGr - GlideRecord of BU request record
      	 * @param {GlideRecord} contractGr - GlideRecord of signed contract record. This will be available only for amendments. 
              * For new contract request, this will be null.
         * Make sure to check for null before using contractGr
      	 * @param {String} requestType - Helps to identify if the request is `amendment` or `cmr`
      	 * @param {String} application - Id of application. Helps to identify to which Business unit or appplication the contract request belongs to
      	 * @returns {Object} - Key value pairs of fieldName and its value in data sub-object
         * contractGr will be provided only in case of amendment request type.
         * Based on the request type, can add required mapppings for CMR record.
         * For New contract request, mapping can be done from parentRequestGr to ContractRequest record
         * For Amendment, mapping can be done from parentRequestGr and contractGr to ContractRequest record
      	 * Example- { data: {'account': 'xyz_sys_id', 'end_date': '2025-12-07'} }
      	 */
      	copyDataFromBUToCMR: function(parentRequestGr, requestType, contractGr,  application) {
                  data: {
                            'account': parentRequestGr.getValue('account'),
                            'end_date': parentRequestGr.getValue('contract_end_date'),
                  	},
      
          type: 'ContractManagementExt'
      };
      注:
      親契約リポジトリレコードフィールドと契約要求フィールドのデータタイプは一致する必要があります。
    7. [Update (更新)] を選択します。
    8. [拡張ポイント] フォームで、[ 更新] を選択します。

    タスクの結果

    契約要求が開始されると、修正要求の開始時に選択された関連する契約リポジトリレコードの対応する値が、設定されたフィールドに自動的に入力されます。