1
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 3 years have passed since last update.

[ServiceNow] カタログOnLoad時の実行順

Posted at

サービスカタログ表示時に実行されるOnload処理の実行順を調べた覚え書き。

結論

  • Catalog Client Script → UI Policy の順で実行
  • Catalog Client Script はOrder順
  • UI Policy はVariable Set → Catalog Item の順

きっかけ

カタログアイテムと変数セットでそれぞれに表示制御が定義されていて、どれがどの順で動いているのかよくわからなくなっていた。

検証方法

カタログアイテムを作成し、OnLoadのUI Policy, Catalog Client Scriptを作成。
さらに変数セットを作成し、こちらにもOnLoadのUI Policy, Catalog Client Scriptを作成。
それぞれの実行時に下のようなコードを追加。

alert.js
alert("トリガーされたイベント名");

スクリーンショット 2020-08-15 17.56.14.png

カタログの試行(Try it)でダイアログが表示される順を確認する。

Orderが実行順に影響することもありえるので、Orderの値を変更して再検証を行う。

検証結果

  • Catalog Client Script → UI Policy の順で処理される
  • Catalog Client Script はOrder順
  • UI Policy はVariable Set → Catalog Item の順

スクリーンショット_2020-08-15_18_01_21.jpg

スクリーンショット_2020-08-15_18_01_29.jpg

スクリーンショット_2020-08-15_18_01_46.jpg

スクリーンショット_2020-08-15_18_02_23.jpg

追加検証

ついでにRequest Item のUI Policy とClient Script も併せて検証してみました。

検証結果

  • Client Script は Catalog Item → Request Item の順
  • UI Policy も Catalog Item → Request Item の順
1
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
1
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?