Conditional discount column on quote template
- Sumedha Sharma
In the last blog, we discussed how to Create a Quote Template.
Now, for example, you want the Discount Column in your Quote Template to appear only if it has values; else, you don't want that column to be visible & not make your customers wonder why they are not getting a discount.
This can be achieved with the help of Conditional Print Fields.
What is Conditional Print Field?
This field controls whether a Line Column or a Section will appear on the generated pdf.
This is how your pdf looks initially. You can see the Discount Column even when there is no discount.
Log-In to your Salesforce CPQ Org & navigate to the App Launcher & search Quote Templates, click Quote Templates.
2. Select the Quote Template in which you want conditional visibility of Discount Column. In this case, Destreza Salesforce Consulting Proposal.
3. In the selected Quote Template, go to the Related tab.
4. In the Line Columns, navigate to DISC(%) & click Edit from it's drop down menu.
5. Scroll down to Column Options, and click the drop down menu of Conditional Print Field.
Notice how 'None' is selected in this field. In order to Conditionally Print the Discount Column, you need to add the API Name of the discount field in the drop down menu.
6. To accomplish the above step, go to Setup -> Object Manager -> Quote. Now click Fields & Relationship, and select Addl. Disc. Amount - having Data Type as Formula(Currency).
7. After selecting the field, Copy the API Name of this field.
8. Go to Setup -> Object Manager, and select Line Column.
9. From Fields & Relationships, select Conditional Print Field.
10. Scroll down to Values, and click New.
11. Paste the API Name you copied in step 7.
12. Now, let's go back to where we started. Go to the Quote Template that you wanted to change, in this case, Destreza Salesforce Consulting Proposal.
Go to the Related tab & in the Line Columns, navigate to DISC(%) & click Edit from it's drop down menu.
13. Scroll down to Column Options, and click the drop down menu of Conditional Print Field and select the API Name you added in step 11.
14. Click Save.
Now, let's see what changes you have implemented.
15. Go to a Quote in which you havn't applied any additional discounts, in this case Q-00007. Make sure you have selected the Quote Template you modified and click Preview.
And you are DONE!
As you can see, the Discount Column didn't appear if there were no additional discounts applicable.
CONTACT US