「form」ページでカタログ変数を読み取り専用にしたい
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
火曜日
ポータル上の「form」ページにあるカタログ変数フィールドを読み取り専用にしたいです。
ログインユーザーやレコードの条件によっては読み取り専用にしないこともあるため、
クライアントスクリプトでの実装を考えています。
以下は試してみましたが、うまくいきませんでした。
①
g_form.setReadOnly('variables.XXX',true);
g_form.setReadOnly('variables',true);
②
g_form.setReadOnly('producer.XXX',true);
③(カタログ変数以外は読み取り専用になった)
var fields = g_form.getEditableFields();
for (var i = 0; i < fields.length; i++) {
g_form.setReadOnly(fields[i], true);
}
解決策や回避策があれば教えてください。
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
水曜日
The script line you are looking for is:
g_form.setVariablesReadOnly(true);
and of course make sure the client script applies to the sc_req_item table, or whatever you're calling 'form', and that the UI Type = All
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
水曜日
Hi @hirukawakai
If you to make field Read only or Editable based on logged in user in this case you can use g_scratchpad in display business rule and call the scratchpad variable in on load client Script.
Detailed Steps:
- Create a Display Business Rule.
- Determine whether the current user should have edit access (your logic needs to come which role or which group needs access)
- Store the result in g_scratchpad.
- Access g_scratchpad in an onLoad Client Script.
- Set the field as read-only or editable.
Thanks and Regards
Sai Venkatesh