Creating a Project with Conditional Forms
Just as you can create a condition on a variable to specify when it prints, you can create a condition on a form to specify when it prints. A project can have any number of forms, and each form can have any number of conditions. This example includes three forms:
- An invoice for customers in the United States and Canada. This form prints for every customer.
- A Terms & Conditions statement for customers in the United States. This form prints after the standard invoice for customers with U.S. mailing addresses.
- A Terms & Conditions statement for customers in Canada. This form prints after the standard invoice for customers with mailing addresses in Canada.
Create a project with one form
- Start the eFORMz Composer and click File > New Project.
- Right click the project icon, click Add Page, and click OK.
- Right click the page, click Add Form > Blank > OK > OK.
- Right click the form, click Rename, and name the form Invoice.
There are several ways to populate this form with data that are not addressed in this post. More information is at the following page:
https://minisoft.com/support/index.php/part-1-new-project-w-the-document-template-video-only/
Create the secondary forms
Create the forms that have Terms & Conditions. One form for U.S. addresses, and one form for addresses in Canada. The U.S. Terms & Conditions are the same for all U.S. customers, and the Canada Terms & Conditions are the same for all Candadian customers, so this project uses static text:
- Create your U.S. and Canada Terms & Conditions in a text processing program like Microsoft Word.
- Complete the steps in https://minisoft.com/support/index.php/alternate-form-generation/, which lets you transform your documents into .prn format.
- Save your U.S. and Canada Terms & Conditions documents as two separate .prn files, USTerms.prn and CanadaTerms.prn.
- Open the eFORMz project, right click the Page step > Add form.
- Click From file > OK.
- Find USTerms.prn, click it, and then click Open.
- Verify the form properties and click OK.
- Right click the form > Rename. Name the form US Terms.
- Complete Steps 4 – 8 to create a form, Canada Terms, that uses CanadaTerms.prn.
Create conditions on the secondary forms
The Terms and Conditions forms must print the U.S. form for U.S. addresses and the Canada form for Canadian addresses. The following steps create these conditions:
- Right click the U.S. Terms form > Add AND Condition > Is a number.
- In the of variable field, select PostalCode and click OK. U.S. zip codes are all numeric, while Canadian postal codes are alphanumeric. This distinction is how we determine which Terms & Conditions form to use.
- Complete Steps 1 for the Canada Terms form.
- Under the Canada Terms form, right click AND PostalCode Is a number > NOT. This rule means that all alphanumeric postal codes will use the Canada Terms form.
- Save your changes.