|
$id
|
String or Number
|
Required. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys\_id. For more information, see [ServiceNow Fluent language constructs](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-constructs.md).Format: `Now.ID['String' or Number]`
|
|
table
|
String
|
Required. The table of the form to modify.
|
|
shortDescription
|
String
|
Required. A description of the policy and its purpose.
|
|
active
|
Boolean
|
Flag that indicates whether the policy is applied to the form.Default: true
|
|
global
|
Boolean
|
Flag that indicates whether to which form views the policy applies. If true, the policy applies to all views of the table. If false, the policy is specific to the form view specified with the view property.
Default: true
|
|
onLoad
|
Boolean
|
Flag that indicates when the policy executes. If true, the policy runs every time a form is loaded if the conditions are satisfied.Default: true
|
|
reverseIfFalse
|
Boolean
|
Flag that indicates whether to invert the policy behavior when the condition evaluates to false. If true, the policy action is undone when the conditions of its policy evaluate to false.Default: true
|
|
inherit
|
Boolean
|
Flag that indicates whether tables that extend the current table inherit the policy. If true, extended tables inherit the policy.When a child table has an inherited policy from its parent table, the policy on the child table runs first. This event is true regardless of the order of the policies.
Default: false
|
|
isolateScript
|
Boolean
|
Flag that indicates whether to run scripts in isolated scope. If true, the script runs in isolated scope. This property only applies if the runScripts is set to true.Default: false
|
|
conditions
|
String
|
A filter query that specifies the fields and values that must be true for users to access the object. For more information, see [Operators available for filters and queries](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-user-interface/r_OpAvailableFiltersQueries.md). To set conditions using a script, use a client script instead.Conditions are only rechecked if a user manually changes a field on a form. If the change is made by a UI action, context menu action, or through the list editor, it isn’t evaluated.
|
|
runScripts
|
Boolean
|
Flag that indicates whether advanced behavior can be scripted for both true and false conditions. If true, scripts defined with the scriptTrue, scriptFalse, uiType, and isolateScript properties run when applicable. Default: false
|
|
scriptTrue
|
String
|
Client-side script that runs if the conditions of the policy are met. This property is required if the runScripts property is set to true.Format: `function onCondition() {}`
Default: `function onCondition() {\n\n}`
|
|
scriptFalse
|
String
|
Client-side script that runs if the conditions of the policy aren’t met and the reverseIfFalse property is set to true. This property is required if the runScripts property is set to true.Format: `function onCondition() {}`
Default: `function onCondition() {\n\n}`
|
|
uiType
|
String
|
The type of user interface to which the policy applies. This property is required if the runScripts property is set to true.Valid values:
- desktop: The policy applies to desktop interfaces.
- mobile-or-service-portal: The policy applies to mobile and Service Portal interfaces.
- all: The policy applies to all interfaces.
Default: desktop
|
|
actions
|
Array
|
A list of field actions to apply if the conditions are met. For more information, see [actions array](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-ui-policy-api.md).
|
|
relatedListActions
|
Array
|
A list of visibility controls for related lists. For more information, see [relatedListActions array](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/fluent-ui-policy-api.md).
|
|
description
|
String
|
Additional information about the policy.
|
|
modelId
|
String
|
The sys\_id of the parent UI policy to which the policy applies when this policy is inherited. This property works in conjunction with model\_table property.
|
|
modelTable
|
String
|
The name of the parent table to which the policy applies when a UI policy is inherited from a parent table. This property works in conjunction with the model\_id property.
|
|
order
|
Number
|
The execution order in which to apply policies if more than one policy fits the conditions.For inherited UI policies, the extended table's policies are executed first. Then the base table policies are executed.
Default: 100
|
|
setValues
|
String
|
\(Deprecated\) The field values to set using an encoded string format. Use UI policy actions \[sys\_ui\_policy\_action\] instead.
|
|
view
|
Reference or String
|
Required. The variable identifier or name of the UI view \[sys\_ui\_view\] which applies, or the default view. To define a UI view, use the [Record API - ServiceNow Fluent](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/servicenow-sdk/record-api-now-ts.md).To use the default view \(`default_view`\), you must import it:
```javascript
import { default_view } from '@servicenow/sdk/core'
```
|