How to Customize a qForm Solution
qForm is a starter template enhanced for workflow-based solutions. It has built-in secondary data sources that are used for assignments, taxonomy, document history, locking, rating, etc. – most of which are accessible in the built-in taskpane.
Below are some guidelines on how you can accomplish making changes in your qForm solution. These assume that you have followed the steps in this page.
How to localize qForm solutions
To ensure global compatibility, qForm uses a mechanism for providing localized strings for all labels and other static text in the form. To edit the values that already exist, you must open the underlying XML and change the text there.
As seen in the screenshot below, double-clicking any of the expression boxes on the form will show you where the value is pulled from at run-time.
The first thing you will want to do when creating a new form based off of qForm is change the <Form Name> value to the name of the form you are developing. This would be the QdCurrentLanguage/LanguageSource/cv_form_name node.
- Open the QdLanguageSource.xml file with the text editor of your choice and find the node specified by the XPath on the expression box. In this case, we are looking for cv_form_name.
- Edit the value of all instances of this node, making sure to translate the new value into each of the respective languages. Let’s change the form name to ‘My qForm’.
- Save and close QdLanguageSource.xml.
- See the changes in the template UI by right-clicking on the manifest.xsf in InfoPath Design mode and previewing (click ‘Ignore’ if it prompts you to locate the project code).On Preview mode, you’ll see that <Form Name> has now been replaced with My qForm.
- Do the same for all other labels and static texts in the form that you wish to localize.
How to customize the Status values
qForm includes Status workflow in the taskpane, consisting of the following values: Saved, Submitted, Reviewed, Approved, Rejected and Closed. These may not be compatible with your needs, but they are easily customizable when designing your solution.
- Navigate to the folder where the source files were saved, and open QdCurrentLanguage.xml in a text editor such as Notepad.
- Find the section that contains the status values, which looks like this:
- Add a new line. For this example, we will add a status value called Proposed, with a line that will look like this:
- Save and close QdCurrentLanguage.xml.
- Open QdCurrentLanguage.xsd in a text editor such as Notepad.
- Find the section that contains the status values, which looks like this:
- Add a new line for the Proposed status.
- Save and close QdCurrentLanguage.xsd.
- Open QdLanguageSource.xml in a text editor such as Notepad.
- Find the section that contains the status values, which looks like this:
- Add a new entry. For this example, the line that will look like this:
- Save and close QdLanguageSource.xml.
- Open QdLanguageSource.xsd in a text editor such as Notepad.
- Find the section that contains the status values, which looks like this:
- Add a new entry. For this example, the new line will look like this:
- Save and close QdLanguageSource.xsd.Note that you should not change existing strings, but instead add new ones with the customized text, as we have done in these steps.
- Open qFormConfig.xml in a text editor such as Notepad.
- Find the section that contains the status values, which looks like this:
- Add a line within the <StatusOptions> node, above the line for the Saved status, which will look like this:Note that the isClosed value determines whether documents with that status value will be shown in the Catalog view. For example, documents with status Closed are by default not shown in the Catalog.
- For illustration purposes, comment out the line for Saved status. It will look like this:Your final <StatusOptions> node should be similar to this:
- Save and close qFormConfig.xml.
- See the changes in the template UI by right-clicking on the manifest.xsf in InfoPath Design mode and previewing (Click ‘Ignore’ if it prompts you to locate the project code).
- On Preview mode, click on the Status dropdown in the taskpane. You’ll see that Saved has now been replaced with Proposed.
How to set Name and Description
When using qForm, you must remember to set the Name and the Description fields via rules. Having a clear Name and Description is essential for users to tell apart their documents when using FormsBoard.
- As an example, add three fields to your main data source, as shown in the screenshot below:Date uses the today() function to auto-populate to today’s date when the document is created.
- Add a rule to the Purpose field to set the value of the @name attribute field of the qFormConfig.xml secondary data source:…to the value of the Purpose field.Your rule action will look like this:This has set your document’s name equal to the contents of the Purpose field.
- Add a rule to the Author field to set the value of the @description attribute field of the qFormConfig.xml secondary data source:For the Value, use a concat() function to concatenate the Author and the Date fields of the main data source, separated by a dash (-).Your rule action will look like this:This sets your Description to, for example, “John Doe – 08/16/2009”.
After making your changes and customizing as desired, return to the Edit Document Type page in FormsBoard and click on the Upload a new version link, then browse to the updated template in your machine.
Click Save when done.