0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ServiceNow - クライアントスクリプト作成方法

Last updated at Posted at 2023-06-15

1.モジュールを開く

[System Definition] > [Client Scripts]
または、
対象テーブルフォームのコンテキストメニューからアクセスする。
以下はIncidentでの例
image.png

2.新規作成フォームを開く

一覧のNewボタンを押下する。
image.png

3.Typeについて

Typeはこのクライアントスクリプトがどのタイミングで実行されるかを大まかに指定します。
image.png
onCellEdit:レコードの一覧画面で、フィールド値の変更を行ったとき
onChange:レコードのフォーム画面で、フィールド値の変更を行ったとき
onLoad:レコードのフォーム画面で、画面の読み込みが行われたとき
onSubmit:サーバにデータ送信が行われるとき(主に更新ボタンなどを押したとき)

4.スクリプトを記載する

Scriptフィールドに実行したい処理や起動条件等を記載する。
画像の例では、Incidentフォームにて、[Channel]フィールドが"Phone"に変更されたとき、[Category]フィールドを"Hardware"に変更する機能を実装しています。
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?