You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works on both the native platform and service portal / mobile. Typically used with an OnChange catalog client script when you would like to reset all the fields after a certain variable is changed.
3
+
This function clears all editable fields on a form, except those explicitly excluded.
4
+
It works on both the native platform (Classic UI) and Service Portal / Mobile.
5
+
Typically used with an OnChange catalog client script when you want to clear all fields after a certain variable changes.
4
6
5
-
This function does support an exclusion list if there are fields you would like to exclude from being reset, typically you would want to add the field that triggered to the change to the exlusion
7
+
The function returns an array of the field names that were cleared, which can be used for logging or further processing.
6
8
7
-
### Example
9
+
### Exclusion Support
8
10
9
-
```js
10
-
clearFields(['field1', 'field2']);
11
-
```
11
+
You can pass an array of field names to exclude from being cleared.
12
+
This is useful when you want to preserve the value of the field that triggered the change or other important fields.
12
13
13
-
All fields on the form **except** field1 and field2 will be cleared.
14
+
### Example
15
+
```
16
+
clearFields(['short_description', 'priority']);
17
+
```
18
+
// Clears all fields except 'short_description' and 'priority'
0 commit comments