Dynamics 365/ ADXStudio Portal Web Forms offer a very easy way to create a wizard experience for a portal user to step through a number of forms and enter any required information. Often, this is a short, simple process, and users would simply complete the steps and submit the Web Form.
However, you may require a Web Form process that a user may not complete in one sitting. For example, an application form that requires some information that may not be directly to hand. Rather than force the user to begin the process again at a later date, it would be preferable to give them an option to return to the form, maybe via a ‘My Draft Applications’ view or similar, and allow them to finish a partially completed application.
In order to achieve this, it is necessary to understand that Web Forms use Web Form Session records to track which records are linked to the Web Form and where the user currently is within the process. To be able to allow a user to return to an existing Web Form, the Web Form Session’s ID needs to be stored. This can be done using a plugin on the create event of a Web Form Session to store the Web Form Session ID against the primary record, an application record in this example.
Now to return to the existing process, the Web Form URL can be modified to include a sessionid parameter in the following format:
Bear in mind that once the user reaches the final step in the Web Form, the Web Form Session is deactivated, so this needs to be considered if the user can reach the final step and not submit the Web Form. Having the last step as a confirmation/summary page is one solution to this, so the user would never reach this step unless they have completed the process.