public interface RecordRoleService extends Service
RecordRole
s.Modifier and Type | Method and Description |
---|---|
BatchOperation<Void,BatchOperationError> |
batchAssignMissingUsers(List<Record> records,
String roleName,
List<String> userIds)
Creates an operation which can be used to update record roles such that all of the given user IDs are on the
given record role on all of the given records.
|
BatchOperation<Void,BatchOperationError> |
batchUpdateRecordRoles(List<RecordRoleUpdate> recordRoleUpdates)
Adds or removes users and groups from this RecordRole.
|
GetGroupInRecordRolesResponse |
getGroupInRecordRoles(Group group,
List<RecordRole> recordRoles)
For a given group, returns a GetGroupInRecordRolesResponse object that can be used to check if the group is in a
particular record role.
|
GetMissingAssignmentsRecordResponse |
getMissingAssignments(List<Record> records,
String roleName,
List<String> userIds)
Retrieves a
GetMissingAssignmentsRecordResponse which can be used to check for an incompleteness of
record roles. |
GetRecordRolesResponse |
getRecordRoles(List<Record> records)
Deprecated.
as of 18R2.3, replaced by
getRecordRoles(List, String) . |
GetRecordRolesResponse |
getRecordRoles(List<Record> records,
String roleName)
Retrieves GetRecordRolesResponse for the given List of records and for a particular role.
|
GetUserInRecordRolesResponse |
getUserInRecordRoles(String userId,
List<RecordRole> recordRoles)
For a given user ID, returns a GetUserInRecordRolesResponse object that can be used to check if the user is in a
particular record role.
|
RecordRoleUpdate |
newRecordRoleUpdate(String roleName,
Record record)
Updates RecordRoleUpdate.
|
GetRecordRolesResponse getRecordRoles(List<Record> records)
getRecordRoles(List, String)
.records
- List of records. Records cannot be null. Maximum 500.GetRecordRolesResponse getRecordRoles(List<Record> records, String roleName)
This method replaces getRecordRoles(List)
, requiring a single roleName to exclude record roles which are
not necessary for the calling code.
records
- List of records. Records cannot be null. Maximum 500.roleName
- name of role. Invalid values throw errors. Cannot be null or empty.GetUserInRecordRolesResponse getUserInRecordRoles(String userId, List<RecordRole> recordRoles)
userId
- user ID value. Cannot be null.recordRoles
- List of RecordRoles. Cannot be null.GetGroupInRecordRolesResponse getGroupInRecordRoles(Group group, List<RecordRole> recordRoles)
group
- Group object. Cannot be null.recordRoles
- List of RecordRoles. Cannot be null.RecordRoleUpdate newRecordRoleUpdate(String roleName, Record record)
Note that if you are creating a new record, you cannot call this method on a BEFORE_INSERT Event. If you do, this method will throw an invalid record ID error, as the new record does not exist yet. Instead, you should call this method in an AFTER_INSERT Event.
roleName
- name of role. Invalid values throw errors. Cannot be null.record
- record object. Cannot be null.BatchOperation<Void,BatchOperationError> batchUpdateRecordRoles(List<RecordRoleUpdate> recordRoleUpdates)
recordRoleUpdates
- List of RecordRoleUpdate objects. Maximum 500. Cannot be null.GetMissingAssignmentsRecordResponse getMissingAssignments(List<Record> records, String roleName, List<String> userIds)
GetMissingAssignmentsRecordResponse
which can be used to check for an incompleteness of
record roles.
The given roleName must be a valid option on each included Record
.
records
- a List of Records to check. Cannot be null or exceed 500 Records.roleName
- name of a document record role, for example, approver__cuserIds
- a List of user IDs. Cannot be null or exceed 500 IDs.BatchOperation<Void,BatchOperationError> batchAssignMissingUsers(List<Record> records, String roleName, List<String> userIds)
The given roleName must be a valid option on each included Record
.
The way that errors are handled can be specified on the returned BatchOperation
. Once error-handling has
been specified, the method BatchOperation.execute()
must be called to finally execute the update.
For example:
recordRoleService.batchUpdateRecordRoles(recordRoleUpdates).rollbackOnErrors().execute()
records
- a List of records. Cannot be null or exceed 500 records.roleName
- name of a record role, for example, approver__vuserIds
- a List of user Ids. Cannot be null or exceed 500 IDs.Copyright © Veeva Systems 2017–2019. All rights reserved.