Conditionally Rendering Template Sections In Salesforce CPQ
Suppose there is a scenario in which you are generating a Quote Template and you need the template sections to be displayed based on certain condition. You can do this by using ‘Conditional Print Field’ field in Template Section object. It is a picklist field that stores API names of Quote object fields.
Scenario: There are 10 products that you provide. A user selects 3 products as Quote Line Items. And when the user generates the quote template, you want to add content related to the products that user selected and not for all 10 products.
Create custom settings that map product name with related field name.
Write a trigger to check / uncheck check boxes conditionally.
Add API names of fields created in Quote object for each product in Conditional Print Field field in Template Section object.