UserCriteria - Scoped
-
- UpdatedAug 1, 2024
- 3 minutes to read
- Xanadu
- API reference
The UserCriteria API provides methods to create, modify, and delete user criteria records using scripts.
To use this class in a scoped application, use the sn_uc
namespace identifier. The User Criteria Scoped API plugin (ID: com.glideapp.user_criteria.scoped.api) must be enabled to access this API.
UserCriteria - UserCriteria()
Creates an instance of the UserCriteria class.
Example
UserCriteria - UserCriteria(String sys_id)
Creates an instance of the UserCriteria class with the specified sys_id.
Name | Type | Description |
---|---|---|
sys_id | String | sys_id of the user criteria. |
Example
UserCriteria - create(Object columnValues, Boolean standardUpdate)
Creates a user criteria with specified values in the user_criteria table. Values specified in columnValues override the values provided via setters.
Name | Type | Description |
---|---|---|
columnValues | Object | Key and value pairs for a column and its value. |
standardUpdate | Boolean | Set to true to enable the running of engines and workflow. |
Type | Description |
---|---|
String | sys_id of the created user criteria. |
Example
Output:
UserCriteria - deleteRecord()
Deletes the current user criteria.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | If true, the user criteria is deleted. If false, no user criteria is found to delete. |
Example
Output:
UserCriteria - read(String columns)
Displays the mapping for the attribute and value pairs of the catalog item.
Name | Type | Description |
---|---|---|
columns | String | Array of catalog item attributes. |
Type | Description |
---|---|
Object | Mapping for the attribute and value pairs of the catalog item. |
Example
Output:
UserCriteria - setActive(Boolean active)
Specifies if the user criteria is active.
Name | Type | Description |
---|---|---|
active | Boolean | If true, the user criteria is active. If false, the user criteria is inactive. |
Type | Description |
---|---|
void |
Example
UserCriteria - setAdvanced(boolean advanced)
Specifies if the user criteria has an advanced script.
Name | Type | Description |
---|---|---|
advanced | Boolean | If true, the user criteria has an advanced script. If false, the user criteria does not have an advanced script. |
Type | Description |
---|---|
void |
Example
UserCriteria - setCompanies(String companies)
Sets the company property for the user criteria.
Name | Type | Description |
---|---|---|
companies | String | Comma-separated list of the company sys_ids to be set for the user criteria. |
Type | Description |
---|---|
void |
Example
UserCriteria - setDepartments(String departments)
Sets the department property for the user criteria.
Name | Type | Description |
---|---|---|
departments | String | Comma-separated list of the department sys_ids to be set for the user criteria. |
Type | Description |
---|---|
void |
Example
UserCriteria - setGroups(String groups)
Sets the group property for the user criteria.
Name | Type | Description |
---|---|---|
groups | String | Comma-separated list of the group sys_ids to be set for the user criteria. |
Type | Description |
---|---|
void |
Example
UserCriteria - setLocations(String locations)
Sets the location property for the user criteria.
Name | Type | Description |
---|---|---|
locations | String | Comma-separated list of the location sys_ids to be set for the user criteria. |
Type | Description |
---|---|
void |
Example
UserCriteria - setMatchAll(Boolean match_all)
Sets the match_all property for the user criteria.
Name | Type | Description |
---|---|---|
None | match_all | If true, all conditions set as properties for the user criteria should be
fulfilled. If false, at least one condition set as a property for the user criteria should be fulfilled. |
Type | Description |
---|---|
void |
Example
UserCriteria - setName(String name)
Sets the name property for the user criteria.
Name | Type | Description |
---|---|---|
name | String | Name of the user criteria. |
Type | Description |
---|---|
void |
Example
UserCriteria - setRoles(String roles)
Sets the role property for the user criteria.
Name | Type | Description |
---|---|---|
roles | String | Comma-separated list of the role sys_ids to be set for the user criteria. |
Type | Description |
---|---|
void |
Example
UserCriteria - setScript(String script)
Sets the script for the user criteria.
Name | Type | Description |
---|---|---|
script | String | Script to be set for the advanced user criteria. |
Type | Description |
---|---|
void |
Example
UserCriteria - setUsers(String users)
Sets the user property for the user criteria.
Name | Type | Description |
---|---|---|
users | String | Comma-separated list of the user sys_ids to be set for the user criteria. |
Type | Description |
---|---|
void |
Example
UserCriteria - update(Object columnValues, String reason)
Updates the current catalog item with the specified values.
Name | Type | Description |
---|---|---|
columnValues | Object | Mapping for the column name and the value pairs. |
reason | String | Reason for updating the catalog item. |
Type | Description |
---|---|
String | Returns the sys_id of the created user criteria. |
Example
Output:
On this page
- UserCriteria - UserCriteria()
- UserCriteria - UserCriteria(String sys_id)
- UserCriteria - create(Object columnValues, Boolean standardUpdate)
- UserCriteria - deleteRecord()
- UserCriteria - read(String columns)
- UserCriteria - setActive(Boolean active)
- UserCriteria - setAdvanced(boolean advanced)
- UserCriteria - setCompanies(String companies)
- UserCriteria - setDepartments(String departments)
- UserCriteria - setGroups(String groups)
- UserCriteria - setLocations(String locations)
- UserCriteria - setMatchAll(Boolean match_all)
- UserCriteria - setName(String name)
- UserCriteria - setRoles(String roles)
- UserCriteria - setScript(String script)
- UserCriteria - setUsers(String users)
- UserCriteria - update(Object columnValues, String reason)