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

Ankur Bawiskar
Tera Patron
Tera Patron

@Pirakawa 

not possible.

You can create a variable of type Custom, add your custom widget to it and that widget can have the button and it will have the logic.

Types of service catalog variables 

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

Ankur Bawiskarさん

 

ご回答ありがとうございます。

とても参考になりました!

「送信」ボタンの下にボタンを配置する方法はなく、カタログ内にボタンを配置することしかできないのですね。

 

しかし、この方法で実施してみたところ、通常のカタログでは動作が確認できましたが、

レコードプロデューサーでは動作が確認できませんでした・・・

レコードプロデューサーには対応していないのでしょうか?

@Pirakawa 

share screenshot where it worked and what config you did to show that?

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_0-1758172585188.png

 

これを、レコードプロデューサーの変数「カスタム」のウィジェットに追加しています。

serviceportal画面ではボタンが表示されていることは確認できているのですが、ボタンを押しても何も実行されません。またエラーも表示されておりません。。