Friday, August 28, 2015

A Better Way to Open Nintex Task Forms in Edit Mode Using Nintex Forms for Office 365

This blog post takes a fresh look at opening task forms in edit mode using new functionality in Nintex Workflow and Nintex Forms for Office 365. This is a complementary post to a solution I posted earlier.

You may have noticed that Nintex has finally added editable task forms to Nintex Workflow for Office 365. Now when you drop in a “Start a Task Process” or “Assign a Task” action you will see this new function on the dropdown menu:

There is still no option to open the form directly in to edit mode however this can be accomplished very quickly using Nintex Forms and a little JavaScript. First, open up Form Settings in the top ribbon.


Once you have that open, simply expand the Custom JavaScript section and drop in the new code.


Here is the code for reference:

if(window.location.href.indexOf("mode=1") === -1) {
   var newUrl = window.location.href.replace("mode=2", "mode=1");

The way this code works is by modifying the URL. If you look at the URL for the form in Display mode and the URL for the form in Edit mode you will see that there is only one small difference. Mode=2 tells us that the form is in Display mode and Mode=1 tells us that the form is in Edit mode. What this code does is look for Mode=1 and if it does not find it, it replaces Mode=2 with Mode=1 so the form is now in Edit mode.

And that’s it! Opening task forms in Edit mode is that simple with Nintex Forms for Office 365. If you do not have Nintex Forms for Office 365 please reference my previous blog on how to accomplish this with default task forms.

All credit to Greg Ostrowski here at Rightpoint for the custom JavaScript!