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?
Yes you can create a conditional merge section on a template. You basically 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.
The other option around this type of concept is to create a formula that can provide lets say 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 that are different. Otherwise using conditional merge sections can make more sense when more differences. Another option is having two templates. And your button code 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.