Full Use Case:
Conditional Coding: We will have some templates that will have different versions of. For example, we have a template that contains 2 versions, a “lease” version and a “loan” version. The idea would be to merge this document into one template but use conditional coding and logic to populate the appropriate details (ex. On the mentioned template there may be a field that should say “Loan Agreement” if the product is a loan but would then say “Lease Agreement” if the product is a lease). In my past experience I have used “If / Then” coding to do this. Does RS Documents allow for this?
One way to do this is you can create a conditional merge section on a template. You would then create a formula field that is a checkbox that can check the box on one condition or leave unchecked if another condition. Then in the template builder, you select this field and indicate to use it as a conditional merge section and you put this merge code in the beginning of the section and end of the section.
Another other option around this type of concept is to create a formula that can provide, in this example, the title of the agreement and in the formula field you would have what ever logic you need to display “Loan Agreement” or “Lease Agreement”. This could be good strategy if only a few things are different. Otherwise using conditional merge sections in Option 1 can make more sense when more differences.
A third option would be to have two templates. And in your button code that you click to merge the document can have an IF statement in the button code to decide which Document Action to use for the document based on some field value.