The CreatorCon Call for Content is officially open! Get started here.

レコードプロデューサーにボタンを追加する方法

Pirakawa
Tera Contributor

はじめまして。

 

現在、レコードプロデューサーを作成しているのですが、

「送信」ボタンの下に自分で作成したボタンを配置して、押下するとスクリプトが走るようにしたいです。

Pirakawa_0-1758075445978.png

 

方法をご教授いただけますでしょうか。

 

1 件の受理された解決策

@Pirakawa 

this should work and set the variable correctly if you are using correct variable name and the value

Remove line 5 and add these inside the function

 var g_form = $scope.page.g_form || window.g_form;
      if (g_form && g_form.setValue) {
        g_form.setValue('u_subtotal', true);
      }

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

元の投稿で解決策を見る

8件の返信8

追記です。

 

押下したときに、ログを吐かせる処理を追加したところ正常にログが吐き出されました。

しかし、相変わらずチェックを入れるという動作は動いていません。

 

エラー内容を確認したところこのようになっておりました。

TypeError: Cannot set properties of undefined (setting 'u_subtotal')

 

これは変数がウィジェット内で設定がされていないからエラーになったということでしょうか。

@Pirakawa 

this should work and set the variable correctly if you are using correct variable name and the value

Remove line 5 and add these inside the function

 var g_form = $scope.page.g_form || window.g_form;
      if (g_form && g_form.setValue) {
        g_form.setValue('u_subtotal', true);
      }

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

最高です!!!!!できました!!!!!!ありがとうございました!!!!!

@Pirakawa 

Glad to help.

Happy learning.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader