Three systems draw the files customers receive. Which one draws a file depends on the document and on whether the org is running in FSR or FIS mode. UAT today: FSR mode, Schedule print switch on, both document engine types active.
| File | FSR mode (UAT today) | FIS mode |
|---|---|---|
| 1 · Schedule PDF | Salesforce draws itDynamic Document engine, right after the order is saved | Not madeThe FIS invoice carries its own schedule section |
| 2 · Invoice PDF | Business Central draws itSalesforce receives the finished PDF, files it and emails it | FIS draws itSalesforce receives the finished PDF, files it and emails it |
| 3 · Certificate | Salesforce draws itSFReg decides, the Dynamic Document engine renders | FIS draws itSalesforce only asks FIS to print |
The list of what was bought and who is booked. Salesforce makes it in a background job a moment after the order is saved, files it on the Order and attaches it to the purchase summary email.
| Attendee | Phone | NZQA | |
|---|---|---|---|
| Attendee One | Yes | ||
| Attendee Two | No | ||
| Attendee Three | Yes |
Schematic, sample data. Header numbers, products before training, one card per course with its attendees, GST-inclusive total, delivery panel.
DynamicScheduleService renders page DynamicSchedulePDF from template Schedule_Standard. If the engine cannot produce it, the legacy page OrderSchedulePDF renders in a second hop.OrderAPIOutbound on) and OrderSchedulePrint on. Either one off means no PDF.Schedule-<customerNo>_<orderNo>.pdf, filed on the Order.OrderConfirmation, from info@). Private Ambulance Membership and website downgrade orders get the file on the Order but no email (QA and UAT since 09-Nov-26).Salesforce never draws an invoice. The finance system draws it and posts the finished PDF back. Salesforce names it, files it on the Order and emails it. Credit notes and donation receipts come in through the same door.
| Description | Qty | Amount |
|---|---|---|
| First Aid Level 1 | 3 | $000.00 |
| First aid kit | 2 | $000.00 |
Schematic, sample data. The layout and wording belong to the finance system, so Salesforce cannot change what the invoice says.
cc.salesorder.create through AIS. FIS: the order event through Mule.POST api/v2/financialDocument → flow SF_Inbound_FinancialDoc_API_Handler → FinancialDocumentAPIHandler → NotificationRestResource (type OrderInvoice). FIS: Mule posts to /v1/notifications as the My StJohn user.OrderInvoice_<orderNo>_Combined_<PS invoiceNo>.pdf. FIS: Invoice_<invoiceNo>_Combined_<ref>.PDF. Both on the Order.Notification. In FSR, FinancialDocumentBillingLinkJob also links the file to the Billing Transaction.CreditNote_…) and donation receipts (DonationRcpt_…).OrderInvoice_…PS… files filed by API IntegrationUser. FIS-mode days (21 to 29-Oct): Invoice_3530… files filed by My StJohn.Starts when the tutor marks an attendee competent. The booking moves to Certificate Requested (CR), and the mode decides who prints. Either way the PDF ends up filed on the booking and emailed to the attendee.
Cert_ PDF on the booking, which SFDocs then indexes.Schematic, sample data. A4 landscape. Each slot is filled from the certificate template chosen for the product.
PUT /v1/contactAssetRoles with status CR. The daily CertificateRequestBatch and the Generate Certificate link use the same request service.SFReg_CertificateRequestService → SFReg_CertificateEntitlement (NZQA, standard, or hold) → SFReg_CertificateIssueQueueable, five bookings per hop → DynamicCertificateService → page DynamicCertificatePDF.PRINT_CERTIFICATE (flow Publish_FIS_Update_Details) → Mule → FIS prints → file and email come back through My StJohn. Took 27 to 61 minutes in UAT.Cert_<First>_<Last>_<bookingNo>_<yyyyMMdd>.pdf, with _NZQA before the date on NZQA certificates. FIS: Cert_<First>_<Last>_<no>_<no>.PDF. Both on the booking (ContactAssetRole__c).EMAIL_POST_COURSE_CERT) with the file attached, then CR → CS. FIS: template AttendeeCertificate from training@, CR → CP → CS.Two parts with a hard line between them. SFReg decides who gets which certificate, sends the email and marks the booking as sent. The Dynamic Document engine only draws the PDF and files it.
Schematic, sample data. Layout Landscape_Classic. Wording, colours and images are edited in the Dynamic Document Manager, with no deployment.
| # | Part | Comes from |
|---|---|---|
| 1 | Background | Template image File |
| 2 | Logo | Template image File |
| 3 | Heading | Template Heading_Text__c |
| 4 | Attendee name | Booking Service_Recipient__c, else the Contact name, else the Lead name |
| 5 | Completion text | Template Completion_Text__c |
| 6 | Course | The Asset name on the booking |
| 7 | NZQA credits | Template Credits_Text__c; it can pull the product's own rule with {rule:NAME} |
| 8 | Date, valid until | Service_Start_Date__c; Service_End_Date__c, else completion plus the template's validity years |
| 9 | Signature | Template image File, signatory name and title |
| 10 | Footer | Template Footer_Text__c |
| 11 | Training ID | Booking ExternalCode__c |
| Step | What happens | Where in the code | UAT today |
|---|---|---|---|
| 1 Ask | Every request enters one door. A booking whose certificate was already sent is answered "already sent" and set back to CS, so a certificate is issued once. | SFReg_CertificateRequestService.requestBulk |
Mode setting certificateGenerationMode__c = Salesforce |
| 2 Decide | No NZQA add-on on the product, or NZQA declined: standard. NZQA wanted, registration finished, NSN present and verified: NZQA. NZQA wanted but any of those missing: not ready. | SFReg_CertificateEntitlement |
|
| 3 Hold | A not-ready booking is parked at C and a hold Case is raised for CSC. It is released when the attendee finishes. At eight weeks the closure batch opts them out of NZQA and a standard certificate goes. | SFReg_PostCourseCertGate, SFReg_CertHoldCaseService, SFReg_PostCourseCertClosureBatch |
Hold gate on; closure after 8 weeks |
| 4 Queue | One background job for all entitled bookings, five per hop. The next hop is queued first, because filing a certificate uses the job's only spare queue slot. | SFReg_CertificateIssueQueueable |
|
| 5 Resolve | The engine reads the product's rule, CERTIFICATE_NZQA or CERTIFICATE_NON_NZQA, folded Family → Offer → Variant → Option. The rule names the template. No rule or no template means nothing is drawn and an error is logged. |
DynamicCertificateService, DynamicDocumentService, DynamicDocumentRuleResolver |
Templates Certificate_NZQA_Dyn and Certificate_Non_NZQA_Dyn, both active, validity 2 years |
| 6 Render | The page is drawn as a PDF, A4 landscape. The controller fills the tokens (attendee, course, dates, training ID, certificate number) into the template's wording and places the three images. | DynamicDocumentPageRenderer, page DynamicCertificatePDF, DynamicCertificatePdfController, DynamicDocumentImageService |
Document type Certificate active |
| 7 Store | The PDF is saved as a File on the booking. The number in the name is the booking's own number. SFDocs sees the new File and indexes it for the Documents portal. | DynamicDocumentFileStore |
Last 30 days: 35 engine-made certificate files, 5 with the _NZQA marker |
| 8 Deliver | The booking is locked and re-checked, then the post-course email goes with the File attached. The NZQA Credit add-on is set to match and the booking moves CR → CS. If the email fails the booking stays at CR and the daily batch retries. | RegistrationEmailService.dispatchCertificate (EMAIL_POST_COURSE_CERT, or EMAIL_AUTO_OPT_OUT_CERT after a closure) |
Two edge cases. An attendee with no email address, or who has opted out, still gets the File on the booking and moves to CS with no email. A retry draws a new File each time, so a booking whose email failed can carry more than one.
Found by reading every PDF page and every Apex class that creates a file or an email attachment in the UAT export of 09-Nov-26.
| File | Format | Started by | Drawn by | Components | Where it lands |
|---|---|---|---|---|---|
| Credit note | Finance issues a credit | Business Central FIS | Same route as the invoice, type CreditNote |
File on the Order, email to the customer, Documents portal | |
| Donation receipt | A donation on an order | Business Central FIS | Same route as the invoice; file DonationRcpt_… |
File on the Order, email, Documents portal | |
| Membership letter | CSC clicks Print/Download Letter on a membershipAcknowledge, Renewal, Lapsed, Downgraded Order, Purchase Summary | Salesforce | printLetterModal → AM_PrintLetterController → page AM_PrintLetter |
Downloads in the browser; filed on the Order as <Type> Letter - <recipient>.pdf; a Task is logged |
|
| Mail-house letters | DATA | Scheduled letter run, or the Campaign Letter Builder | Mail house | MailHouseBatchable writes Letter__c rows from Letter_Type__c |
No file in Salesforce. The mail house reads the rows and prints the letter |
| Supplier purchase order | An order with unshipped supplier-fulfilled items is processed | Salesforce | OrderController.send_PO_PDF_ToSupplier → page PO_PDF → Notification SupplierPO |
Emailed to the supplier; address and file name from Vendor_details__mdt |
|
| Group billing pro forma invoice | Group billing run, scheduled or manual | Salesforce | RVGroupBillingService → RVGroupBillingInvoicePdfGenerator → page RvGroupBillingProformaInvoice |
File <Bill-to> (<acct>) <Month> pro forma invoice.pdf |
|
| Group billing remittance | CSV | Same group billing run | Salesforce | RVGroupBillingService |
Email attachment … <Month> Remittance.csv |
| NZQA report | TXT | Staff run the NZQA report | Salesforce | NZQAReportController → NZQAReportCreatorBatchexception, final and NSN validation reports |
Saved as a File and emailed |
| Medical alarms activation list | CSV | Telecare report job | Salesforce | ReportRetriever → TelecareReportEmailManager |
Emailed to managers |
| Data check reports | CSV | Scheduled job | Salesforce | ReportScriptSchedule → ReportScriptJobsQueuable |
Emailed: bookings with no certificate file, orders with an invoice number but no PDF |
| Documents portal ZIP | ZIP | Customer or CSC ticks documents and chooses Download as ZIP | The browser | docsDocumentList, docsAccountDocuments with JSZip |
Download only. Nothing new is stored |
| Quote PDF | Standard Salesforce quote PDF | Salesforce | Flow ContentDocument_AfterSave_QuotePDF_StartSync reacts when one is savedNot traced further today |
File on the Quote |
SFDocs watches new files and indexes one when its name starts with cert_, invoice_, creditnote_ or donationrcpt_. UAT holds 3,781 invoices, 389 training certificates, 354 donation receipts and 172 credit notes in the portal index.
Schedule PDFs and membership letters have no matching prefix, so they stay on the Order only.
Business Central invoices are filed as OrderInvoice_…. That does not start with invoice_, so SFDocs skips them.
OrderInvoice_ files filed, 0 portal invoices with a PS number.Cert_.