Job Splitters
Last updated
Was this helpful?
This page applies only to Visualforce and SDJobs document generation.
Do not use job splitters unless instructed by S-Docs.
A special merge field, {{!JOB_SPLITTER}}, that allows a template to be split into chunks when it is generated in order to avoid various Salesforce limitations
When implementing {{!JOB_SPLITTER}} tags, it's crucial to carefully identify complex elements in the template source code to determine optimal placement. This includes:
Queries (e.g., related lists)
Conditional logic (RENDER statements)
Styling elements (such as images and smart formatting in DOCX)
It's important to underscore the need for placing job splitters directly in the base HTML source code. Tags or logic split across multiple transactions are prone to failure. Therefore, it's essential to add efficiencies from the backend to avoid disrupting any existing HTML structures. Front-end placements should be considered less precise and should be avoided when possible.
It's important to use job splitters judiciously. While Apex jobs have complexity limits, the Apex job queue also has restrictions, and each {{!JOB_SPLITTER}} increases the number of jobs added to the queue. Using too many splitters can reduce overall efficiency, as breaking processes into too many asynchronous transactions may end up taking longer than if fewer job splitters were applied. Striking the right balance is key to optimizing performance.
Common errors that can be resolved with job splitters are “Regex too complicated” and “Apex CPU time limit exceeded”
The following line of code breaks up the processing of Component Queries into chunks of 5 records at a time. The above considerations for the Job Splitter merge field also apply to this tag.
Last updated
Was this helpful?
Was this helpful?
<splitEvery> 5 </splitEvery>
