985
edits
| Line 423: | Line 423: | ||
# If you need to implement a F3 process (fastest finger first), you can use a Flow to auto-assign the shift to the Invitation’s Contact, completing the workflow, without requiring that a user approves the acceptance | # If you need to implement a F3 process (fastest finger first), you can use a Flow to auto-assign the shift to the Invitation’s Contact, completing the workflow, without requiring that a user approves the acceptance | ||
## Note, you might need to also develop a Flow that will block anyone else from accepting an invitation to a shift that is already booked | ## Note, you might need to also develop a Flow that will block anyone else from accepting an invitation to a shift that is already booked | ||
== Scheduling Context Provider Invitations Schedulable == | |||
Version 4.0 of the app introduces a new requirement to define a new "invitation" schedulable within the Scheduling Context Provider. The content of the scheduler is defaulted with these values:<syntaxhighlight lang="json"> | |||
{ | |||
"objectType":"b3s__Invitation__c", | |||
"contactFieldPath":"b3s__Contact__c", | |||
"contactRecordReference":"b3s__Contact__r", | |||
"shiftFieldPath":"b3s__Shift__c", | |||
"statusFieldPath":"b3s__Status__c", | |||
"contactsLoader":"contacts", | |||
"allowSelectingThreshold":25, | |||
"allowBookingThreshold":25, | |||
"contactTitle":[ | |||
{ | |||
"label":"", | |||
"fieldPath":"Name", | |||
"targetRecordIdPath":"Id", | |||
"formatter":"string", | |||
"hideIfNull":true | |||
}, | |||
{ | |||
"label":"Title", | |||
"fieldPath":"Title", | |||
"formatter":"string", | |||
"hideIfNull":true | |||
} | |||
], | |||
"invitationTitle":[ | |||
{ | |||
"label":"", | |||
"fieldPath":"Name", | |||
"targetRecordIdPath":"Id", | |||
"formatter":"string", | |||
"hideIfNull":false | |||
}, | |||
{ | |||
"label":"Status", | |||
"fieldPath":"b3s__Status__c", | |||
"formatter":"string", | |||
"hideIfNull":false | |||
}, | |||
{ | |||
"label":"Contact", | |||
"fieldPath":"b3s__Contact__r.Name", | |||
"targetRecordIdPath":"b3s__Contact__c", | |||
"formatter":"string", | |||
"hideIfNull":false | |||
}, | |||
{ | |||
"label":"Shift", | |||
"fieldPath":"b3s__Shift__r.Name", | |||
"targetRecordIdPath":"b3s__Shift__c", | |||
"formatter":"string", | |||
"hideIfNull":false | |||
}, | |||
{ | |||
"label":"Seen", | |||
"fieldPath":"b3s__Seen_Timestamp__c", | |||
"formatter":"dateTime", | |||
"hideIfNull":false | |||
}, | |||
{ | |||
"label":"Created", | |||
"fieldPath":"CreatedDate", | |||
"formatter":"dateTime", | |||
"hideIfNull":false | |||
} | |||
], | |||
"shiftTitle":[ | |||
{ | |||
"label":"", | |||
"fieldPath":"Name", | |||
"targetRecordIdPath":"Id", | |||
"formatter":"string", | |||
"hideIfNull":false | |||
}, | |||
{ | |||
"label":"Start", | |||
"fieldPath":"b3s__Absolute_Start_Time__c", | |||
"formatter":"time", | |||
"hideIfNull":false | |||
}, | |||
{ | |||
"label":"End", | |||
"fieldPath":"b3s__Absolute_En_Time__c", | |||
"formatter":"time", | |||
"hideIfNull":false | |||
}, | |||
{ | |||
"label":"Status", | |||
"fieldPath":"b3s__Status__c", | |||
"formatter":"string", | |||
"hideIfNull":true | |||
}, | |||
{ | |||
"label":"Job", | |||
"fieldPath":"b3s__Job__r.Name", | |||
"formatter":"string", | |||
"hideIfNull":true | |||
}, | |||
{ | |||
"label":"Site", | |||
"fieldPath":"b3s__Site__r.Name", | |||
"formatter":"string", | |||
"hideIfNull":true | |||
} | |||
], | |||
"contactFilters":[ | |||
{ | |||
"label":"Contact", | |||
"type":"reference", | |||
"value":{ | |||
"labelField":"Name", | |||
"valueField":"Id" | |||
} | |||
} | |||
], | |||
"shiftFilters":[ | |||
{ | |||
"label":"Status", | |||
"type":"select", | |||
"value":{ | |||
"valueField":"b3s__Status__c", | |||
"options":[ | |||
{ | |||
"label":"New", | |||
"value":"New" | |||
}, | |||
{ | |||
"label":"Confirmed", | |||
"value":"Confirmed" | |||
}, | |||
{ | |||
"label":"Cancelled", | |||
"value":"Cancelled" | |||
} | |||
] | |||
} | |||
} | |||
], | |||
"canAssign":{ | |||
"condition":{ | |||
"allOrSome":"some", | |||
"selectors":[ | |||
{ | |||
"field":"b3s__Status__c", | |||
"operator":"equals", | |||
"value":"New" | |||
} | |||
] | |||
} | |||
}, | |||
"canSelect":{ | |||
"condition":{ | |||
"allOrSome":"some", | |||
"selectors":[ | |||
{ | |||
"field":"b3s__Status__c", | |||
"operator":"equals", | |||
"value":"New" | |||
} | |||
] | |||
} | |||
}, | |||
"canCancelInvite":null, | |||
"canAssignInvite":null | |||
} | |||
</syntaxhighlight>The important attributes are as follows: | |||
* contactsLoader - the name of a scheduling loader responsible for loading contacts for matching | |||
* allowSelectingThreshold - set this to an integer between 0 and 100 to limit which match results can be selected by the user for invitation. We will compare this value against the relative match % | |||
* allowBookingThreshold - set this to an integer between 0 and 100 to limit which match results can be assigned.We will compare this value against the relative match % | |||
* contactTitle - an array of [[Metadata Field Definition|fields]] starting from the Contact object. We will use this when displaying the matched contact. The fields are loaded through the records retreived from the defined contactsLoader | |||
* invitationTitle - an array of fields starting from the Invitation object. We will use this to render the fields on the "already invited" section. The fields are automatically loaded (extracted from the definition itself) | |||
* shiftTitle - an array of fields starting from the Shift object. The fields will be used for rendering shift match result. | |||
* contactFilters - an array of [[Filters Metadata Definition|filters]] that will be used for showing a filter on the matched results when doing candidate search | |||
* shiftFilters - an array of filters that will be used for showing a filter on the matched results when doing shift search | |||
* canAssign - a conditional with the context of the Shift. You can prevent users from selecting a match result using this. E.g. you can prevent shift match result from being selected if the shift's Status is "New" | |||
* canSelect - a conditional with the context of the Shift. You can prevent users from selecting a match result using this. | |||
* canCancelInvite - a conditional with the context of the Invitation. You can prevent users from cancelling an invite using this. | |||
* canAssignInvite - a conditional with the context of the Invitation. You can prevent users from assigning an invite using this. | |||
== Compliance on Shifts == | == Compliance on Shifts == | ||