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?

Record Producer 8:Record Producer の画面項目の表示・非表示を制御する【ServiceNow】

Posted at

※この記事はServiceNow初心者が学習用のために記載した記事です。内容について誤っている場合がございます。不足点などございましたらコメントいただけますと幸いです。

ServiceNow の Record Producer では、画面上の項目(カタログ変数)を動的に表示・非表示にする 方法は複数存在する

画面上の項目(カタログ変数)を動的に表示・非表示にする 方法

  • Client Script
    • g_form.setDisplay(‘変数名’, false/true); → 完全に非表示/表示
    • g_form.setVisible(‘変数名’, false/true); → 非表示にしても領域は残る
  • UI Policy
    • 条件に応じてGUIで設定可能(スクリプト不要)
    • Visible アクションで True/False を設定
  • 関連リストの変数テーブルのフィールドから変更する
    • Visibleフィールドで True/False を設定
      • 変数やフィールドが ユーザーインターフェース上で表示されるかどうか を制御する

使い方

g_form.setDisplay(‘variable_name’, false/true);

  • g_form.setDisplay(‘変数名’, false); → 非表示
  • g_form.setDisplay(‘変数名’, true); → 表示

例:

function onLoad() {
    g_form.setDisplay('variable_name', false); // 変数を非表示
}

適用タイミング:

  • onLoad(画面表示時)
  • onChange(他のフィールドの値変更時)

g_form.setVisible(‘variable_name’, false/true);

  • setDisplayとの違いは、非表示にしても領域が残ること
  • 通常は setDisplay を推奨

UI Policy を使う方法

  • 条件に応じてGUIで制御できるので、Script不要
  • Condition を設定し、Visible のアクションで True/False を選択
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?