Creating Document Submissions

From 3B Knowledge
Jump to navigation Jump to search

Intro

With version 6.22 of the onboarding package, we have introduced some new behaviour for creating Document Submissions records.

Old Behaviour

Previously, we would create a document submission record, when a Form, Template, Document, Assessment or Session (a.k.a. document) was created against all Document Assignment records that implement a document linked to the submitted resource.

New Behaviour

From version 6.22+, we are changing the logic so we only create document submission records if:

  • there is no previous submission against the submitted document
  • we will not create a document submission if the previous record is "Closed" - i.e. the Status is "Approved" or "Pending Review" and the document submission is not Expired and not Expiring Soon

With this change, we aim to ensure that document submissions are created only against the document assignment that needs a submission to be recorded. In other words, if the same document is requested in multiple document packs and has been previously submitted, we will only attempt to create a document submission against the assignment which has no submission, or the previous submission is "Open" - i.e. the document has expired or is expiring soon and the status is "Rejected" or "Requested Update"

Logic

Creating document submissions against the document assignment record happens automatically via an Apex Trigger in the onboarding package. Find below a description of how that logic operates per document type.

Document Traces (Templates)

What triggers the automation? Assignment Status Requirements
A b3d__Document_Trace__c record which is inserted or updated so that we have a b3d__Contact__c or b3o__X3B_Application__c mapped.

The trace should not have the flag b3d__Has_Error__c, the b3d__Record_ID__c should also be populated and the status should be "Submitted" which is determined by having either b3d__Document_Downloaded__c or b3d__Document_Signed__c as "true"

The b3o__Document_Assignment__c is identified by the b3d__Contact__c on the b3d__Document_Trace__c. The b3o__Document_Assignment__c must be b3o__Active__c = true (i.e. not hidden from the candidate).

Finally, if the b3o__Document_Assignment__c already has a b3o__Document_Submission__c against the b3o__Document__c linked to the b3o__Document_Pack__c, we will check if the previous submission is "Open" or "Closed". - Open - if the b3o__Status__c of the b3o__Document_Submission__c is either "Rejected" or "Requested Update" or the either formulae b3o__Is_Expired__c or b3o__Is_Expiring_Soon__c evaluate to true - Closed - if the b3o__Status__c of the b3o__Document_Submission is "Approved", "Pending Review" and the formulae b3o__Is_Expired__c and b3o__Is_Expiring_Soon__c evaluate to false

Form Responses (Forms)

What triggers the automation? Assignment Status Requirements
A b3f__FormResponse__c record which is inserted or updated so that we have a b3f__Contact__c or b3o__X3B_Application__c mapped.

The response should not have the b3f__Type__c field set to "COMPLETE"

The b3o__Document_Assignment__c is identified by the b3f__Contact__c on the b3f__FormResponse__c. The b3o__Document_Assignment__c must be b3o__Active__c = true (i.e. not hidden from the candidate).

Finally, if the b3o__Document_Assignment__c already has a b3o__Document_Submission__c against the b3o__Document__c linked to the b3o__Document_Pack__c, we will check if the previous submission is "Open" or "Closed". - Open - if the b3o__Status__c of the b3o__Document_Submission__c is either "Rejected" or "Requested Update" or the either formulae b3o__Is_Expired__c or b3o__Is_Expiring_Soon__c evaluate to true - Closed - if the b3o__Status__c of the b3o__Document_Submission is "Approved", "Pending Review" and the formulae b3o__Is_Expired__c and b3o__Is_Expiring_Soon__c evaluate to false

Candidate Scorecards (Assessments)

What triggers the automation? Assignment Status Requirements
A b3o__Candidate_Scorecard__c record which is inserted or updated so that we have a b3o__Contact__c mapped. The b3o__Document_Assignment__c is identified by the b3o__Contact__c on the b3o__Candidate_Scorecard__c. The b3o__Document_Assignment__c must be b3o__Active__c = true (i.e. not hidden from the candidate).

Finally, if the b3o__Document_Assignment__c already has a b3o__Document_Submission__c against the b3o__Document__c linked to the b3o__Document_Pack__c, we will check if the previous submission is "Open" or "Closed". - Open - if the b3o__Status__c of the b3o__Document_Submission__c is either "Rejected" or "Requested Update" or the either formulae b3o__Is_Expired__c or b3o__Is_Expiring_Soon__c evaluate to true - Closed - if the b3o__Status__c of the b3o__Document_Submission is "Approved", "Pending Review" and the formulae b3o__Is_Expired__c and b3o__Is_Expiring_Soon__c evaluate to false

Submitter (Sign)

What triggers the automation? Assignment Status Requirements
A b3d__Submitter__c record which is inserted or updated so that we have a b3d__Contact__c mapped and b3d__Signed_Timestamp__c is not null. The b3o__Document_Assignment__c is identified by the b3d__Contact__c on the b3d__Submitter__c. The b3o__Document_Assignment__c must be b3o__Active__c = true (i.e. not hidden from the candidate).

Finally, if the b3o__Document_Assignment__c already has a b3o__Document_Submission__c against the b3o__Document__c linked to the b3o__Document_Pack__c, we will check if the previous submission is "Open" or "Closed". - Open - if the b3o__Status__c of the b3o__Document_Submission__c is either "Rejected" or "Requested Update" or the either formulae b3o__Is_Expired__c or b3o__Is_Expiring_Soon__c evaluate to true - Closed - if the b3o__Status__c of the b3o__Document_Submission is "Approved", "Pending Review" and the formulae b3o__Is_Expired__c and b3o__Is_Expiring_Soon__c evaluate to false

Invitations (Sessions)

What triggers the automation? Assignment Status Requirements
A b3o__Session_Invitation__c record which is inserted or updated so that we have a b3o__Contact__c mapped and b3o__Session_Schedule__c is not null or b3o__Invitation_Status__c has changed to "Booked". The b3o__Document_Assignment__c is identified by the b3o__Contact__c on the b3o__Session_Invitation__c. The b3o__Document_Assignment__c must be b3o__Active__c = true (i.e. not hidden from the candidate).

Finally, if the b3o__Document_Assignment__c already has a b3o__Document_Submission__c against the b3o__Document__c linked to the b3o__Document_Pack__c, we will check if the previous submission is "Open" or "Closed". - Open - if the b3o__Status__c of the b3o__Document_Submission__c is either "Rejected" or "Requested Update" or the either formulae b3o__Is_Expired__c or b3o__Is_Expiring_Soon__c evaluate to true - Closed - if the b3o__Status__c of the b3o__Document_Submission is "Approved", "Pending Review" and the formulae b3o__Is_Expired__c and b3o__Is_Expiring_Soon__c evaluate to false