File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ 7. UI Policy Best Practices
2
+ Description: This check ensures that UI policies are used effectively, including hiding fields rather than disabling them when applicable.
3
+
4
+ Example: Check if UI Policy uses disabled instead of hidden.
5
+ Best Practice: It's often better to hide fields instead of disabling them for better user experience.
6
+ Scan: Identify UI policies that disable fields instead of hiding them.
7
+ javascript
8
+ Copy code
9
+ function(uiPolicyCheck) {
10
+ var script = uiPolicyCheck.getFieldValue('script');
11
+ if (script.indexOf('g_form.setDisabled') > -1 && script.indexOf('g_form.setVisible') === -1) {
12
+ uiPolicyCheck.addViolation('UI Policy uses "setDisabled" instead of "setVisible", which may lead to a poor user experience.');
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments