The Document Assignment (b3o__Document_Assignment__c) now shows live counts of the documents requested from the contact, so admins and flows can see onboarding progress at a glance without opening the portal.
| Field | Type | Meaning |
|---|---|---|
Requested Documents (b3o__Requested_Documents__c) |
Number | How many documents of the pack are currently visible/required from the contact (after evaluating each document's conditional rendering rule). |
Submitted Documents (b3o__Submitted_Documents__c) |
Number | Requested documents with at least one submission. |
Completed Documents (b3o__Completed_Documents__c) |
Number | Requested documents whose latest submission is Approved and not expired. |
Outstanding Documents (b3o__Outstanding_Documents__c) |
Formula (Number) | Requested - Submitted. |
All Documents Submitted (b3o__All_Documents_Submitted__c) |
Formula (Checkbox) | True when at least one document is requested and all are submitted. |
All Documents Completed (b3o__All_Documents_Completed__c) |
Formula (Checkbox) | True when at least one document is requested and all are completed. |
The checkbox formulas are ideal entry criteria for flows and reports (e.g. "notify recruiter when all documents are completed").
b3o__Requested_Document__c), materialises which documents of the pack are actually requested from each contact — one record per (Document Assignment, Document) pair. It stores b3o__Is_Required_From_Contact__c, b3o__Is_Submitted__c, b3o__Is_Completed__c and b3o__Latest_Submission__c.b3o__Onboarding_Trigger_Control__c.b3o__Disable_Requested_Documents_Trigger__c (hierarchy custom setting) bypasses the automatic creation/sync triggers during data loads. Run the backfill batch afterwards (below). The count rollup itself is never bypassed.
Document Assignments created before this version have no Requested Documents and their counts are blank. Backfill them once after installing/upgrading:
sf apex run).Database.executeBatch(new b3o.RequestedDocsRecalcBatch(
'SELECT Id FROM b3o__Document_Assignment__c'
), 5);
Notes:
b3o__Document_Assignment__c or Contact records (contacts are resolved to their assignments automatically):// Only assignments for contacts still onboarding
Database.executeBatch(new b3o.RequestedDocsRecalcBatch(
'SELECT Id FROM Contact WHERE Onboarding_Status__c = \'In Progress\''
), 5);
Because document visibility can depend on data outside the pack (contact fields, certificate expiry dates, etc.), you decide when to recalculate. The package exposes an invocable action:
Action: 3B Recalculate Requested Documents (category: 3B Onboarding)
Input: Assignment Ids — a list of b3o__Document_Assignment__c record Ids.
b3o__Document_Assignment__c where b3o__Contact__c = the contact).recordId for a manual "Recalculate" button.The action returns immediately; the recalculation runs asynchronously in the background (it self-chains for large packs). Counts update within moments.
b3o.RequestedDocumentsHelper.recalculate(new Set<Id>{ assignmentId });
Safe to call from triggers and from already-async contexts (falls back to inline processing when no queueable slots remain).
All recalculation paths are idempotent — running them twice is harmless.