Build a Product Bundle Hierarchy from Token Data Apex Example for Document
Generation
This Apex class transforms flat product token data into a parent-child hierarchy based
on parent product relationships. During document generation, parent and child items are bundled
together with nested child items.
Required Editions
Available in: Lightning Experience
Available in: Professional, Enterprise, Unlimited, and
Developer Editions
For example, a quote includes a bundled product with multiple add-ons. Context service
fetches all line items without hierarchy. The transform plug-in builds a bundle structure by
attaching child items to their parent product. The template then shows the bundle with its
nested child items, matching the expected layout.
Note Make sure to include repeater tokens for each hierarchy level that you want to render. The
transform plug-in can build deeper hierarchies, but the template controls which levels appear
in the generated document.
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.