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.

adxstudio-portal-webform-step

 

 

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.

return to an existing dynamics 365 adxstudio portal web form step

 

Now to return to the existing process, the Web Form URL can be modified to include a sessionid parameter in the following format:

http://<yourportalurl>/<web-form-name>/?sessionid=<web-form-session-id>

If you are wanting to show the user a list of their open Web Forms in an Entity List, such as a ‘My Draft Applications’ view, then this will require some JavaScript to modify the list’s View Action URL to point to the URL described above including the sessionid parameter.

In our example, the sessionid parameter for each record in the list was obtained by adding the field containing the Web Form Session Id as a column on the view used by the Entity List. This was then hidden using JavaScript on the Entity List record in the same function that updated the primary column’s URL to point at the Web Form Session URL.

custom-javascript

 

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.