DFFS: Multiple variations on one form

If you have a very complicated form with a lot of rules and complexity, you might want to split this up in different configurations. Here is an example of how you can do this.

How to enable this form switch

This example will create separate configurations for the form based on a “status” column named “CaseStatus”. To start using this switch, all you have to do is to add these lines of code to the CEWP – above the script tag that refers DFFS_Frontend_min.js.

<script type="text/javascript">
// Override pageId to load different DFFS configurations for different statuses in the "CaseStatus" field.
var dffs_formTypeSwitch = "CaseStatus";

Please note that you must update DFFS_frontend to v4.272 or later to support this option.

How does it work?

What this code does is to get the current value from the “CaseStatus” field, and appending it to the pageId it uses to query the DFFS configuration list for the correct configuration to load.

How to configure the different forms

To be able to configure the forms for the different “Statuses” you can either enter DFFS backend from a form loaded with the correct status, or edit the URL in DFFS backend directly to change for example “formType=Not started” to “formType=In progress” in the URL example below:

https://contoso.com/DFFS/WebPartPages/DFFS_Backend.aspx?targetList={46e7516d-a6f3-400e-992f-e08338da2ccc}&targetListBaseUrl=/DFFS&formId=/lists/dffs dev/editform.aspx?formType=Not started&formType=3&Source=/DFFS/Lists/DFFSDEV/EditForm.aspx?ID=4

I hope this makes sense. If it does not, please post any questions or comments in the forum.