How the Documents tab goes from UAT to Production: what to do before, what is deployed, what to do after, and which jobs run.
Overview
This release puts the Documents tab on the Account and Contact pages in Production. It deploys 64 new components and adds 4 access entries to one existing profile. Users see nothing new until the tab is added to the two pages by hand.
- 65Components64 new, 1 existing profile changed
- 27Package membersNamed in
package.xml - 16Pre-deployment steps6 done, 4 in progress, 6 to do
- 12Post-deployment steps4 change Production
Guardrail (the release lead, 30-Nov-26). No code change, data update or any change in Production without the release lead's confirmation. Every step that changes Production is marked. The release lead runs each one, or confirms it first; one confirmation does not carry to the next step. Claude only reads in Production.
What users get on day one, and known limits
- A Documents tab on Account and Contact: list, filter, search, open a PDF, download several as one ZIP. Every view and download is logged.
- History is not loaded. The tab lists only documents filed after the deploy. Production filed 10,321 matching PDFs in the 7 days to 30-Nov-26, about 1,470 a day.
- Invoices named
OrderInvoice_(Business Central) are not picked up. Production filed none in the 7 days to 30-Nov-26. - A certificate is skipped if its PDF is filed while the booking is not yet at Certificate Sent and the status changes later. 2 cases in UAT; none seen in Production in the 21 days to 27-Nov-26.
- The tab is shown by rule to three profiles: St John General User, System Administrator, St John System Administrator. St John System Administrator - Read Only (2 users) is not covered.
Run order
- Finish the UAT proof in the browser. The profile access and the tab rule are deployed in UAT; the three-login check is still open (P-14).
- Validate in Production, check only, all local tests. About 1 h 40 min. Gives the Id for the quick deploy (P-11).
- Quick deploy in the CAB window. 64 new components and 4 access entries on the profile. Users see nothing new yet (D-01).
- Jobs, admin access, first-document check. Documents start to register as new PDFs are filed (D-02 to D-05).
- Add the tab, with its profile rule, to the two record pages. The 117 profile users and the admins see the Documents tab (D-07).
- Smoke test, monitoring, hand-over (D-08 to D-12).
Pre-deployment
Nothing in this section changes Production.
CAB approval for this scope: Documents tab on the Account and Contact record pages for internal users. Window date and peer reviewer named.
Done whenCAB approved; window date and reviewer written in this row.
- Owner
- The release lead
- Org
- -
- When
- Before the window
Scope frozen. In: the 65 components on the Components sheet (64 new, plus 4 access entries on the St John General User profile). Out: DOCS site, portal help, booking handler update (the release lead 27-Nov: "Yes, leave it out"), history load. See Not included.
Done whenComponents and Not included sheets match what is validated in P-11.
- Owner
- The release lead
- Org
- -
- When
- 30-Nov-26
Help taken out of the package. The release lead confirmed 30-Nov-26 ("help is only for site"). Three edits applied in a new folder, Workspaces/SFDocs_Prod_Internal_Bundle_2026-11-30: (1) package.xml: member DocsHelpController removed; (2) Documents_Admin: its class access removed (4 lines); (3) DocumentPipeline_Test: test method helpControllerGuardsNonContactUser removed (12 lines), the only code that called the class. The class file itself is not in the new folder. No reference to it is left in any deployable file except one comment line in the test class. The 27-Nov folder (27 members) is kept unchanged.
Done whenDone 30-Nov-26. UAT check-only dry run 0AfAD00000VZHli0AH: Succeeded, CheckOnly true, 64 of 64, no tests.
- Owner
- The release lead confirmed; Claude applied
- Org
- Local files
- When
- 30-Nov-26
Documents_Admin can now read every field on the queue (11 fields) and on the access log (6 fields). The release lead confirmed 30-Nov-26. Done by switching on View All Fields for DocumentStaging__c and DocumentAccessLog__c in the set, the same way the set already covers Document__c: two lines changed, read only, no edit access added. New folder: Workspaces/SFDocs_Prod_Internal_Bundle_2026-11-30_v2. This goes beyond the UAT copy, where both are still off, so the read on these two objects has not been seen working in an org yet; the same setting does work on Document__c in UAT.
Done whenDone 30-Nov-26. UAT check-only dry run 0AfAD00000VZIpp0AH: Succeeded, CheckOnly true, 64 of 64, no tests. First real proof of the read is D-05.
- Owner
- The release lead confirmed; Claude applied
- Org
- Local files
- When
- 30-Nov-26
Decision (the release lead, 30-Nov-26): keep as UAT. Documents_Admin keeps its read on Sites_Header__c and 7 of its fields (site content object, already in Production). No package change. Checked in Production 30-Nov-26, query only: the object and all 7 fields exist (Background_Colour__c, Image_Link__c, Logo_Asset_Name__c, Logo_Placement__c, Logo_Public_Url__c, Title_Alignment__c, Title__c), so the set will deploy.
Done whenDone 30-Nov-26. Package unchanged (v2 folder).
- Owner
- The release lead
- Org
- Local files
- When
- 30-Nov-26
Decision (the release lead, 30-Nov-26): access by profile, not by permission set. The St John General User profile gets the access Documents_Support carries, so all 117 active users on it see the tab and the documents: CSC 37, Service Line Administrator 32, Finance Administrator 28, All 12, Youth 7, Sales 1. Admins (System Administrator 27, St John System Administrator 2) already hold View All Data and Author Apex and need no grant; St John System Administrator - Read Only (2) is not covered. The tab gets a rule by profile so other users of the two pages do not see it (D-07). Package: new folder Workspaces/SFDocs_Prod_Internal_Bundle_2026-11-30_v3 with a profile file of 4 entries. This is the first change to an existing Production component in this release, and the profile route was deployed to UAT on 30-Nov-26 (P-14).
Done whenDone 30-Nov-26. UAT check-only dry run 0AfAD00000VZVVJ0A5: Succeeded, CheckOnly true, 65 of 65, no tests. UAT proof: see P-14.
- Owner
- The release lead decided; Claude built
- Org
- Local files
- When
- 30-Nov-26
Production state, queries only. Result 30-Nov-26: none of the 64 new components exist; the St John General User profile exists (last changed 25-Nov-26) and holds no Documents access; no trigger on ContentDocumentLink or ContentVersion; no Documents_* permission sets; no Docs% scheduled jobs; static resources jszip (33,954 bytes, 18-Jun-26) and zip only. Unchanged since 27-Nov.
Done whenSame result on the window day.
- Owner
- Claude (read only)
- Org
- STJOHN-PROD
- When
- 30-Nov-26; repeat on the window day
Things the package relies on exist in Production: ContactAssetRole__c with Role__c, Type__c, Status__c, Description__c, Service_Start_Date__c, Service_End_Date__c, Contact__c, Lead__c, Asset__c; Asset.OrderItem__c; Account.STJAccountNumber__c; AccountContactRelation; Sites_Header__c with the 7 fields named in Documents_Admin (named by the permission set only; no code in the package reads it; re-checked 30-Nov-26). Asset.SBQQ__OrderProduct__c is absent in UAT and Production; the generator checks before using it.
Done whenAll present (checked 30-Nov-26).
- Owner
- Claude (read only)
- Org
- STJOHN-PROD
- When
- 30-Nov-26
UAT has not moved since the bundle was built. Fresh retrieve 30-Nov-26: 85 of 86 files identical to the 27-Nov bundle; the one difference is the intended Documents_Admin trim (DocumentService access removed).
Done whenStill identical just before P-11.
- Owner
- Claude (read only)
- Org
- HHSJ-UAT
- When
- 30-Nov-26; repeat before P-11
Save Production copies before any change: Account_Record_Page (last changed 24-Sep-26 NZ time) and Contact_Record_Page (24-Nov-26) by metadata retrieve, the St John General User profile (retrieved together with the objects and classes it refers to, so the copy is complete), the scheduled job list, and the jszip resource details. Kept in the Bridge for rollback.
Done whenTwo page files, the profile and the job list saved, dated.
- Owner
- Claude (read only), on the release lead's word
- Org
- STJOHN-PROD
- When
- T-1 day
Production check-only validation with all local tests (command on the Summary sheet). Production will not validate Apex without tests, and named tests fail the 75% per-class rule (QA 17-Oct-26: DocumentGenerator 58.5%, DocumentReconciliationBatch 69.8%). Allow about 1 h 40 min: the two 3,704-test validations in Production on 26-Nov-26 took 1 h 28 and 1 h 39.
Done whenSucceeded, CheckOnly true, 65 of 65 components, 0 test failures. JSZip reported as Created, not Changed. Validation Id written here.
- Owner
- The release lead
- Org
- STJOHN-PROD
- When
- T-2 days
Keep the quick deploy alive. A validation can be quick-deployed for 10 days, and any other deploy to Production in between cancels it. Check DeployRequest just before the window; if another deploy has landed, repeat P-11.
Done whenNo Production deploy between the validation and the window.
- Owner
- The release lead
- Org
- STJOHN-PROD
- When
- Window day
Agree the lists. Documents_Support: nobody in this release; access comes with the St John General User profile (117 active users, P-06). Documents_Admin: named admins only, and the list must include whoever runs the checks in D-05 and D-09.
Done whenAdmin list agreed and saved.
- Owner
- The release lead
- Org
- -
- When
- T-2 days
UAT sign-off by a real CSC user. Proven 26-Nov-26 as a CSC user: the list loads, 44 of 44 documents on Glen Nevin Household. Not yet confirmed in the browser: View opens the PDF, Download, multi-file ZIP, access-log row written. Profile route in UAT, 30-Nov-26, on the release lead's go: the profile file was deployed (0AfAD00000VZVjp0AH) and the profile differs from its before-copy by the 4 entries only (object, field, class, tab and user permissions, layout assignments, record types, apps and login IP ranges compared). By query, three users on the profile with no permission set (CSC, Finance Administrator, Service Line Administrator) can read the document rows and the PDF files; a Telecare user cannot read the rows; an admin with no set can. The tab rule was deployed to both pages (0AfAD00000VZRYA0A5). Still to do in the browser: the tab shows for the three profiles and for no other; list, View, Download and ZIP work for a profile user. The browser check waits for the release lead to sign in to UAT.
Done whenAll four confirmed in the browser by the reviewer; the tab rule and the profile route seen working in the browser.
- Owner
- CSC reviewer
- Org
- HHSJ-UAT
- When
- Before CAB
Blast radius of the new file trigger. It is the first trigger on ContentDocumentLink in Production, so it runs for every file linked anywhere. Claude's read of the code, 30-Nov-26: after insert only; returns with no query unless the file is linked to an Order or a booking; then one query; starting the background job is guarded by the limit check. One unguarded statement: the insert of the queue rows. If that insert ever failed, the Invoice_ / Cert_ file link itself would fail. Volume: 10,321 matching PDFs filed in Production in the 7 days to 30-Nov-26. Second unguarded statement, found 30-Nov-26: the call that starts the background job (handler line 74). If the org ever used up its daily allowance of background jobs (250,000; about 100,000 in use), that call would be refused and, by a reading of the code that is not tested, the file link would fail too. Day to day SFDocs adds about 1,470 jobs. Open gate since the 23-Nov release plan.
Done whenThe release lead and the developer accept the review, or the insert is guarded in a later package.
- Owner
- Release lead + developer
- Org
- Local
- When
- Before P-11
Tell the CSC team before go-live: where the tab is, that it starts empty and fills as new documents are filed (history is not loaded), and who to contact. The CSC guide was published 17-Oct-26.
Done whenMessage sent by the release lead.
- Owner
- The release lead + CSC lead
- Org
- -
- When
- T-1 day
Components to deploy
A deploy result shows 65: the 27 members named in package.xml plus the 38 fields inside the three objects.
- Objects 3
- Fields 38
- Page layouts 3
- Lightning pages 2
- Trigger 1
- Apex classes 11
- Lightning components 3
- Static resource 1
- Permission sets 2
- Profile 1
| # | Type | API name | In Production | What it does |
|---|---|---|---|---|
| 1 | Objects | Document__c | New | The register: one row per customer document, pointing at the file (no file copy). Private sharing, field history on. |
| 2 | Objects | DocumentStaging__c | New | Processing queue: one row per PDF waiting to be registered, with attempt count and failure note. |
| 3 | Objects | DocumentAccessLog__c | New | Audit: one row each time a staff member views or downloads a document. |
| 4 | Page layouts | Document__c-Document Layout | New | Record layout for a document row. |
| 5 | Page layouts | DocumentStaging__c-Document Staging Layout | New | Record layout for a queue row. |
| 6 | Page layouts | DocumentAccessLog__c-Document Access Log Layout | New | Record layout for an access-log row. |
| 7 | Lightning pages | Document_Record_Page | New | Lightning record page for a document row. |
| 8 | Lightning pages | Document_Access_Log_Record_Page | New | Lightning record page for an access-log row. Needed: the object's View action points at it. |
| 9 | Trigger | ContentDocumentLinkTrigger | New | Runs when a file is linked to a record (after insert). First trigger on file links in Production. See P-15. |
| 10 | Apex classes | ContentDocumentLinkTriggerHandler | New | Keeps only PDFs linked to an Order (Invoice_, CreditNote_, DonationRcpt_) or a booking (Cert_) and queues them. Does nothing for any other file. |
| 11 | Apex classes | DocumentStagingProcessor | New | Background job that works the queue, one row at a time, up to 3 attempts. |
| 12 | Apex classes | DocumentGenerator | New | Builds the Document__c row from the Order or the booking. Certificates: Primary + Attendee + status CS only. |
| 13 | Apex classes | DocumentStagingScheduler | New | Schedulable for the 15-minute sweep of the queue. |
| 14 | Apex classes | DocumentReconciliationBatch | New | Nightly check of the last 7 days. Writes a summary to the debug log only: no email, no data change. |
| 15 | Apex classes | DocumentBackfillBatch | New | Loads historical documents. Ships because DocumentPipeline_Test calls it; does nothing until someone runs it. NOT run in this release. |
| 16 | Apex classes | DocumentAdminService | New | Serves the Documents tab (search by Account or Contact, open, download) and writes the access-log rows. |
| 17 | Apex classes | DocumentSearchFilters | New | Filters and paging for the tab (20 rows a page, 200 at most). |
| 18 | Apex classes | DocumentTestFactory | New | Test data builder. |
| 19 | Apex classes | DocumentGenerator_Test | New | Tests for the generator. |
| 20 | Apex classes | DocumentPipeline_Test | Prod copy | Tests for the trigger handler, queue, batches and the tab service. Prod copy: the one help test method removed (P-03, the release lead confirmed 30-Nov-26). |
| 21 | Lightning components | docsAccountDocuments | New | The Documents tab itself. Exposed for Account, Contact and Order record pages. |
| 22 | Lightning components | docsListColumns | New | Column definitions used by the tab. |
| 23 | Lightning components | docsEmpty | New | Empty-state panel used by the tab. |
| 24 | Static resource | JSZip | New | JSZip v3.10.1 (JavaScript, 97,630 bytes) for the multi-file ZIP download. Different resource from Production's existing jszip (zip archive, 33,954 bytes); both sit side by side in QA and UAT. |
| 25 | Permission sets | Documents_Support | New | For CSC users: classes DocumentAdminService + DocumentSearchFilters; Document__c Read + View All Records; DocumentAccessLog__c Read + Create. Not assigned in this release: the St John General User profile carries the same access (P-06). Kept for a single user outside that profile. |
| 26 | Permission sets | Documents_Admin | Prod copy | For admins: 6 classes; full access to Document__c, edit on the queue, read + create on the access log; View All Fields on all three; read on Sites_Header__c. Prod copy: DocumentService access removed (27-Nov); help access removed (P-03, 30-Nov-26); View All Fields added on the queue and the access log (P-04, 30-Nov-26). Sites_Header__c read kept as in UAT (P-05). |
| 27 | Profile | St John General User | Changes existing | Existing Production profile with 117 active users (CSC 37, Service Line Administrator 32, Finance Administrator 28, All 12, Youth 7, Sales 1). The package file holds 4 entries only: class access to DocumentAdminService and DocumentSearchFilters; Document__c Read + View All Records; DocumentAccessLog__c Read + Create. This is the access Documents_Support carries. Nothing else of the profile is in the file. Production copy last changed 25-Nov-26: back it up first (P-10). |
Fields inside the three objects
Document__c 21 fields
| Field | Label and type |
|---|---|
Account__c | Account. Lookup(Account). Required. |
AttendeeName__c | Attendee Name. Text(255). |
ContactAssetRole__c | Contact Asset Role. Lookup(ContactAssetRole__c). |
ContentDocumentId__c | Content Document Id. Text(18). Required. External ID. |
DisplayName__c | Display Name. Text(255). Required. |
DocumentNumber__c | Document Number. Text(40). External ID. Unique. |
DocumentType__c | Document Type. Picklist. Required. |
ExpiryDate__c | Expiry Date. Date. |
FileName__c | File Name. Text(255). |
IssuedDate__c | Issued Date. Date. Required. |
OrderNumber__c | Order Number. Text(80). |
Order__c | Order. Lookup(Order). |
ParentRef__c | Parent Ref. Text(18). Required. |
ProductName__c | Product Name. Text(255). |
ServiceRecipientContact__c | Service Recipient (Contact). Lookup(Contact). |
ServiceRecipientLead__c | Service Recipient (Lead). Lookup(Lead). |
SourceBatchRef__c | Source Batch Ref. Text(40). |
SourceCreatedDate__c | Source Created Date. DateTime. Required. |
SourceRunType__c | Source Run Type. Text(40). |
Status__c | Status. Picklist. Required. |
SupersededBy__c | Superseded By. Lookup(Document__c). |
DocumentStaging__c 11 fields
| Field | Label and type |
|---|---|
AttemptCount__c | Attempt Count. Number(4,0). |
ContentDocumentId__c | Content Document Id. Text(18). |
ContentVersionId__c | Content Version Id. Text(18). |
DocumentNumber__c | Document Number. Text(40). External ID. |
Document__c | Document. Lookup(Document__c). |
ErrorDetail__c | Error Detail. LongTextArea(32768). |
IsBackfill__c | Is Backfill. Checkbox. |
LinkedEntityId__c | Linked Entity Id. Text(18). |
ParentType__c | Parent Type. Picklist. |
ProcessingStatus__c | Processing Status. Picklist. Required. |
RouteHint__c | Route Hint. Picklist. |
DocumentAccessLog__c 6 fields
| Field | Label and type |
|---|---|
AccessType__c | Access Type. Picklist. |
AccessedAt__c | Accessed At. DateTime. |
AccessedBy__c | Accessed By. Lookup(User). |
AccessedFrom__c | Accessed From. Text(40). |
Document__c | Document. Lookup(Document__c). |
IPAddress__c | IP Address. Text(45). |
Two files differ from UAT on purpose. Documents_Admin has the site and help class access removed, and View All Fields added on the queue and the access log. DocumentPipeline_Test has the help test method removed. The profile file holds 4 entries only; a real deploy of it to UAT on 30-Nov-26 changed those 4 entries and nothing else.
Validate and deploy
The release lead runs these from the bundle folder. The validation and the quick deploy are one package: nothing is rebuilt in between.
ClaudeDev/_SFDocs/Workspaces/SFDocs_Prod_Internal_Bundle_2026-11-30_v327 members, 65 components. The 27-Nov, 30-Nov (first) and v2 folders are superseded: do not deploy from them.
sf project deploy validate -x manifest/package.xml -l RunLocalTests -o STJOHN-PROD --wait 240Production will not validate Apex without tests, and named tests fail the 75% per-class rule. Allow about 1 h 40 min. Expect Succeeded, CheckOnly true, 65 of 65, 0 test failures.
sf project deploy quick --job-id <validation Id from P-11> -o STJOHN-PROD --wait 60Or the Quick Deploy button in Setup, Deployment Status. A validation can be quick-deployed for 10 days; any other deploy to Production in between cancels it (P-12).
Post-deployment
Steps marked Changes Production are the release lead's to run, or to confirm one at a time.
Quick deploy of the validation from P-11, in the CAB window (command on the Summary sheet). Same package, same Id; nothing is rebuilt. After this step users see nothing new: no tab and no jobs. The 117 users on the profile hold the access from this moment but have nowhere to use it until D-07.
Done whenDeployRequest Succeeded, CheckOnly false, 65 of 65 components.
- Owner
- The release lead
- Org
- STJOHN-PROD
- When
- Window
Read back the 65 components from Production and compare with the package (retrieve and diff, read only). Also: the St John General User profile differs from its P-10 copy by the 4 entries only; ContentDocumentLinkTrigger is Active; jszip unchanged (33,954 bytes, 18-Jun-26); ContactAssetRoleTriggerHandler still the 25-Nov-26 version.
Done whenRead-back equals the package; nothing else changed.
- Owner
- Claude (read only), on the release lead's word
- Org
- STJOHN-PROD
- When
- Straight after D-01
Run scripts/schedule_jobs.apex once (anonymous Apex). Creates Docs Staging Sweep :00, :15, :30, :45 and Docs Reconciliation Nightly at 02:00. The jobs run as the user who runs the script, in that user's time zone.
Done when5 jobs named Docs% in state WAITING.
- Owner
- The release lead
- Org
- STJOHN-PROD
- When
- After D-02
Assign Documents_Admin to the named admins (list from P-13).
Done whenAssignments equal the agreed list.
- Owner
- The release lead
- Org
- STJOHN-PROD
- When
- After D-02
First real documents, queries only. Production filed about 1,470 matching PDFs a day in the week to 30-Nov-26, so the first should register within minutes in business hours. Check: queue rows are created and go to Done; Document__c rows appear with Number and Order filled; nothing Failed. Reading the queue fields: P-04 (done) gives it to holders of Documents_Admin, so the user who runs this check must be on the D-04 list.
Done whenDocument__c rows present; queue rows Done; 0 Failed.
- Owner
- Claude (read only), on the release lead's word
- Org
- STJOHN-PROD
- When
- Within 1 hour of D-01
No assignment step. The release lead 30-Nov-26: access comes with the St John General User profile, which the deploy (D-01) has already changed. Documents_Support is deployed but assigned to nobody. Check by query: the profile shows Document__c Read + View All Records, DocumentAccessLog__c Read + Create and the two class accesses.
Done whenProfile shows the 4 entries; 0 assignments of Documents_Support.
- Owner
- Claude (read only), on the release lead's word
- Org
- STJOHN-PROD
- When
- After D-05
Add the Documents tab by hand in Lightning App Builder on Account_Record_Page and on Contact_Record_Page: a custom tab labelled Documents, placed after Related, holding the component docsAccountDocuments (no properties to set). Set visibility on the tab: User, Profile, Name equals St John General User, OR System Administrator, OR St John System Administrator (three filters, logic 1 OR 2 OR 3). Save. Do not deploy the UAT pages: they carry UAT-only content such as smsHistory.
Done whenTab shows on an Account and on a Contact for the three profiles and for no other; the rest of each page equals the P-10 copy.
- Owner
- The release lead
- Org
- STJOHN-PROD
- When
- After D-06
In Production as a CSC user, then as a non-CSC user on the same profile (for example Finance Administrator), then as an admin: open an Account that has a new document (from D-05). The Documents tab lists it; View opens the PDF; Download works; the multi-file ZIP works. Repeat on a Contact. Then check DocumentAccessLog__c holds a row for each action. Last, as a user on another profile (for example Telecare): the tab is not shown.
Done whenAll pass; access-log rows present.
- Owner
- CSC user + the release lead
- Org
- STJOHN-PROD
- When
- After D-07
Day 1 and day 7, queries only: queue rows by status (Pending drains, Failed is 0); AsyncApexJob errors for DocumentStagingProcessor and the nightly reconciliation; Document__c count against the Invoice_ / CreditNote_ / DonationRcpt_ / Cert_ PDFs filed since D-01; file links by My StJohn still succeeding.
Done when0 Failed; 0 job errors; counts agree.
- Owner
- Claude (read only), on the release lead's word
- Org
- STJOHN-PROD
- When
- Day 1, day 7
Status log entry in the SFDocs Bridge (deploy Id, times, results). Close the CAB change.
Done whenLog entry written the same day.
- Owner
- The release lead + Claude
- Org
- -
- When
- Day 0
Tell the developer what Production holds that their package does not: View All Records on Documents_Support; the Documents_Admin changes; the help test method removed; access on the St John General User profile in place of assignments. Also the skipped-certificate gap (2 cases in UAT). The same changes are missing from QA and from Git; Git only on the release lead's go.
Done whenNote sent by the release lead; the developer confirms for their next package.
- Owner
- The release lead
- Org
- -
- When
- Week 1
Left for later, each as its own change: history load; DOCS site and help; booking handler update; Business Central (OrderInvoice_) invoices.
Done whenEach has an owner and a decision.
- Owner
- The release lead
- Org
- -
- When
- After week 1
Jobs and batches
Three things run in the background after go-live. A fourth, the one-off history load, is not part of this release.
| Job | What it does | When | How it starts |
|---|---|---|---|
Queue processor (DocumentStagingProcessor) | Registers one document per background job, up to 3 attempts. This is what fills the tab. | Within seconds of a matching PDF being filed | By itself, from the file trigger. Nothing to run. |
| Docs Staging Sweep :00, :15, :30, :45 (4 scheduled jobs) | Picks up any queue rows still pending, so nothing is left behind if a job was missed. | Every 15 minutes | scripts/schedule_jobs.apex, once, step D-03 |
Docs Reconciliation Nightly (DocumentReconciliationBatch) | Checks the last 7 days and writes a summary to the debug log. No email, no data change. | 02:00 every night | Same script, step D-03 |
History load (DocumentBackfillBatch) | Loads documents filed before go-live. NOT in this release. | One-off, later, as its own change | By hand. See the next section. |
Schedule the jobs (D-03)
sf apex run -f scripts/schedule_jobs.apex -o STJOHN-PRODRun once. The jobs run as the user who runs the script, in that user's time zone. Expect 5 jobs named Docs% in state WAITING.
What scripts/schedule_jobs.apex contains
// SFDocs: schedule the 5 jobs after the deploy. Run once, in Production, by the release lead.
// 4 staging sweeps (:00 :15 :30 :45) and the nightly reconciliation at 02:00.
DocumentStagingProcessor.scheduleSweeper();
DocumentReconciliationBatch.scheduleNightly();
for (CronTrigger c : [SELECT CronJobDetail.Name, CronExpression, State, NextFireTime FROM CronTrigger WHERE CronJobDetail.Name LIKE 'Docs%']) {
System.debug(LoggingLevel.ERROR, 'JOB|' + c.CronJobDetail.Name + '|' + c.CronExpression + '|' + c.State + '|' + c.NextFireTime);
}sf apex run -f scripts/unschedule_jobs.apex -o STJOHN-PRODThe one-off history load
Not in this release, and not safe to run as built. The class ships, because a test calls it, but nobody runs it. The estimate is from read-only counts in Production on 30-Nov-26 and from two past loads in UAT.
| Phase | What happens | Estimate |
|---|---|---|
| Batch, two runs (financial, certificates) | Scans the PDFs and writes one queue row per document | About 5 to 10 hours |
| Queue | Registers the documents, one per background job | About 11 to 22 days, running continuously |
| Input | Figure |
|---|---|
| Matching PDFs in Production | 1,313,220 (727,078 financial, 586,142 certificates) |
| Linked to an Order or a booking | About 1.26 million (samples: 95.5% and 97.2%) |
| Speed measured in UAT | 78 a minute (10-Sep-26, 4,396 rows) and 40 a minute (17-Oct-26, 439 rows) |
| Production daily limit on background jobs | 250,000, with about 100,000 already in use |
| Floor set by that limit | About 9 days |
| Data storage needed | Up to about 4.8 GB of 38.6 GB free. No file storage: files are linked, not copied. |
| Year filed | Documents | Queue time |
|---|---|---|
| 2018 to 2020 | 88,000 | 1 to 1.5 days |
| 2021 | 135,000 | 1 to 2.5 days |
| 2022 | 148,000 | 1.5 to 2.5 days |
| 2023 | 183,000 | 1.5 to 3 days |
| 2024 | 219,000 | 2 to 4 days |
| 2025 | 210,000 | 2 to 3.5 days |
| 2026 so far | 282,000 | 2.5 to 5 days |
By year is for sizing only. The batch has no date filter today, so it cannot be run in slices without a code change.
Why it is not safe as built
- It would take most of the spare daily allowance of background jobs for two to three weeks. If the allowance ran out, background jobs would be refused for every team.
- The file trigger starts its background job with no error handling (
ContentDocumentLinkTriggerHandler, lines 73 to 74). By a reading of the code that is not tested, new invoice and certificate files would then fail to attach. - Once the batch has written the queue rows there is no throttle and no pause.
What to ask the developer for first
- More than one document per background job. About 25 a job would cut the jobs from 1.26 million to about 50,000.
- A date range on the batch, so it can run newest year first and stop between slices.
- Error handling around the trigger's call that starts the job.
How it would be run, for reference only
// Anonymous Apex. One family at a time. Do not run in this release.
Database.executeBatch(new DocumentBackfillBatch('Financial'), 200);
Database.executeBatch(new DocumentBackfillBatch('Certificate'), 200);
Working: ClaudeDev/_SFDocs/Investigations/SFDocs_Investigation_History-load-duration-Prod_2026-11-30.md
Not included
| Area | Type | Item | Why it is out | Where it stands |
|---|---|---|---|---|
| Site | Experience site | DOCS site (Network, CustomSite, DigitalExperience bundle and its pages) | No external site in this release. | QA and UAT only. Production has no DOCS site (checked 30-Nov-26). |
| Site | ApexClass | DocumentService, DocumentService_Test | Portal back end. | QA and UAT only. Not in Production (checked 30-Nov-26). |
| Site | ApexClass | AuditWriter, AuditWriter_Test | Portal audit writer. The internal tab writes its own audit rows through DocumentAdminService. | QA and UAT only. Not in Production (checked 30-Nov-26). |
| Site | ApexClass | SignupService, SignupService_Test | Portal sign-up. | QA and UAT only. Not in Production (checked 30-Nov-26). |
| Site | LightningComponentBundle | docsDocumentList, docsAccountSelector, docsAccountSelectModal, docsHeaderBanner, docsHeaderBar | Portal pages. | QA and UAT only. Not in Production (checked 30-Nov-26). |
| Site | Flow | SFDocs_Signup_Verify_Email | Portal sign-up email. | QA and UAT only. Not in Production (checked 30-Nov-26). |
| Site | PermissionSet | Documents_Customer | Access for portal customers. | QA and UAT only. Not in Production (checked 30-Nov-26). |
| Access | PermissionSetAssignment | Documents_Support assignments | The release lead 30-Nov-26: access by profile instead. The set ships, assigned to nobody. | Available later for a single user outside the profile. |
| Help | ApexClass | DocsHelpController | Portal help cases. Taken out of the package by the three edits in P-03 (the release lead confirmed 30-Nov-26). | QA and UAT only. Not in Production (checked 30-Nov-26). |
| Help | LightningComponentBundle | docsHelpDrawer | Portal help panel. | QA and UAT only. Not in Production (checked 30-Nov-26). |
| Automation | ApexClass | ContactAssetRoleTriggerHandler (certificate block) | The release lead 27-Nov-26: leave it out. In Production the file trigger has always queued the PDF first, so the block would add nothing. | Production keeps its 25-Nov-26 version. |
| Data | Batch run | History load (DocumentBackfillBatch runs) | Separate change. Production holds 1,313,220 matching PDFs (30-Nov-26), about 1.26 million of them linked to an Order or a booking. Estimate: batch 5 to 10 hours, then the queue 11 to 22 days, because one document is registered per background job. Not safe to run as built (daily allowance of background jobs). Working: Investigations/SFDocs_Investigation_History-load-duration-Prod_2026-11-30.md. The class ships but is not run. | Tab starts empty. |
| Pages | FlexiPage | Account_Record_Page, Contact_Record_Page | Not deployed: the UAT copies carry UAT-only content. The tab is added by hand (D-07). | Production copies stay; saved first in P-10. |
Rollback
Least disruptive first. Every step that changes Production is the release lead's, or needs their confirmation for that step.
| Step | Action | Owner | Changes Production | Check |
|---|---|---|---|---|
| When to roll back | Any of: files fail to attach in Production with an error naming ContentDocumentLinkTrigger; My StJohn invoice or certificate filing starts failing; repeated Apex errors from the Documents tab for CSC users. | The release lead | - | Decision is the release lead's. |
| R1 Hide the tab (minutes) | Remove the Documents tab from the two record pages in Lightning App Builder, or restore the copies saved in P-10. Users lose the tab; nothing else changes. | The release lead | Yes | Pages equal the P-10 copies. |
| R2 Stop the jobs (minutes) | Run scripts/unschedule_jobs.apex: aborts the 5 jobs named Docs%. | The release lead | Yes | No Docs% jobs left. |
| R3 Remove access (minutes) | Remove the Documents_Admin assignments. For the 117 profile users, take the access off the profile: in Setup clear Read on Document__c and DocumentAccessLog__c and the two Apex class accesses on St John General User, or restore the P-10 copy. Hiding the tab (R1) already stops normal use. | The release lead | Yes | No assignments left; profile equals the P-10 copy. |
| R4 Stop the file trigger | Deploy ContentDocumentLinkTrigger as Inactive. This is an Apex deploy to Production, so it needs a test run: allow about 1 h 40 min with all local tests. If a faster stop is wanted, validate the Inactive copy before the window. | The release lead | Yes | Trigger Inactive; file links succeed. |
| R5 Full removal (later) | Destructive deploy of the 64 components as its own change. The three objects hold links to files, not copies, so removing them loses no documents. | Release lead + developer | Yes | Separate change with its own plan. |
Evidence and open items
Proven
- UAT check-only dry run of the v3 bundle:
0AfAD00000VZVVJ0A5, 30-Nov-26, Succeeded, CheckOnly true, 65 of 65, no tests. This proves the packaging, not Production. - Real UAT deploy of the profile file:
0AfAD00000VZVjp0AH, 30-Nov-26. Before and after compare: the 4 entries changed and nothing else. - Tab rule deployed to both UAT pages:
0AfAD00000VZRYA0A5. UAT reads back equal to the deployed files. - By query in UAT, three users on the profile with no permission set (CSC, Finance Administrator, Service Line Administrator) can read the document rows and the PDF files; a Telecare user cannot read the rows.
- Production, queries only, 30-Nov-26: none of the 64 new components exist; the profile exists and holds no Documents access; everything the package relies on is present.
Still open
- Production has not been validated (P-11).
- The browser check in UAT with three logins is not confirmed (P-14).
- The file trigger review is not signed off by the release lead and the developer (P-15).
- CAB approval, window date and peer reviewer (P-01).
- The Production changes are not in QA, Git or the developer's package (D-11).