Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

ACLのスクリプトについて

Potemi
Tera Contributor

ACLの詳細設定のスクリプト部分について助けてください。
やりたいこととしては、
1.ビュー名の判断
2.カラムの特定の値(例:A)が取得できているか
3.Aの場合、チョイスの5,6,7を日活性化する
4.A以外の場合は、表示

以上の条件を入れたスクリプトを参考までに教えていただきたいです。

1件の返信1

yasutaka ono
Giga Guru

以下のように考えました。参考になれば幸いです。

(function() {
  // ビュー名の判断
  if (current.getViewName() === "view_name") {
    // カラムの特定の値が取得できているか
    var columnValue = current.column_name; // カラム名を適切な名前に変更してください
    if (columnValue === "A") {
      // Aの場合、チョイスの5, 6, 7を有効化する
      current.choice_field_name.setDisabled(false); // choice_field_nameを適切なフィールド名に変更してください
      current.choice_field_name.setChoiceList("choice_list_name"); // choice_field_nameとchoice_list_nameを適切な名前に変更してください
    }
  } else {
    // A以外の場合は表示
    gs.log("Access granted for non-A value");
  }
})();