c_SSPApprovalData

Description

Approval and Delegate data functions when data is queried or change in the tables sys_approval_approver or sys_user_delegate

Methods


<static> getApproval( approvalSysId, userSysId ) → {Approval}

Description

Get an approval record for the user, either wn or delegated

Parameters
Name Type Description
approvalSysId sys_id
userSysId sys_id
Returns

<static> getApprovalList( userSysId, delegatedList, input ) → {Array.<ListItem>}

Description

Get a list of pending approvals

Parameters
Name Type Description
userSysId sys_id
delegatedList Array.<sys_id>
input QueryInput

Additional input conditions, supported are state values state

Returns

<static> _mapApprovalRecord( glideRecord, isListItem ) → {Approval}

Description

Map approval record

Parameters
Name Type Description
glideRecord GlideRecord
isListItem boolean
Returns

<static> countApprovalRecords( userSysId ) → {number}

Description

Get a count for records available to approve for the current user

Parameters
Name Type Description
userSysId sys_id
Returns

<static> hasApprovalRecords( userSysId ) → {boolean}

Description

Check if a user has Approval records

Parameters
Name Type Description
userSysId sys_id
Returns

<static> updateApproval( userSysId, approvalSysId, action, comment, delegatedList ) → {boolean}

Description

Update an approval

Parameters
Name Type Description
userSysId sys_id
approvalSysId sys_id
action "comment" | "approve" | "reject"
comment string
delegatedList Array.<sys_id> | undefined
Returns

<static> insertDelegate( record ) → {sys_id|undefined}

Description

Insert a new delegate and returns the sys_id of the new record or undefined if not created

Parameters
Name Type Description
record DelegateRecord

An object that has all the field names and values for the new record to create

Returns

<static> updateDelegate( record ) → {boolean}

Description

Update a delegate and returns true on success

Parameters
Name Type Description
record DelegateRecord

An object that has all the field names and values for the new record to create

Returns

<static> insertOrUpdateDelegate( record ) → {sys_id}

Description

Insert or update a record into the sys_user_delegate table, if record has sys_id an update is performed, otherwise an insert is done

Parameters
Name Type Description
record DelegateRecord

Record object that contains data for insert or update

Returns

Resulting record object with sys_id of the created or updated record


<static> getDelegatesToUser( userSysId ) → {Array.<sys_id>}

Description

Get a list of users sys_id's that a user has been delegated for

Parameters
Name Type Description
userSysId sys_id
Returns

<static> getDelegateItem( delegateSysId, userSysId ) → {Delegate}

Description

Retrieve a delegate record object

Parameters
Name Type Description
delegateSysId sys_id
userSysId sys_id
Returns

<static> _mapDelegateRecord( glideRecord, userSysId ) → {Delegate}

Description

Map gliderecord to Delegate

Parameters
Name Type Description
glideRecord GlideRecord
userSysId sys_id
Returns

<static> getDelegateItemList( userSysId ) → {Array.<ListItem>}

Description

Get a list of delegate items

Parameters
Name Type Description
userSysId sys_id
Returns