Vadim Tabakman

The out of the box start form for starting a Nintex Workflow looks something like this.



 

I've seen a few requests for people who want their form to look a little different. So I thought it was well worth the time to look into developing a custom start form.

To start off we'll make a basic skeleton Visual Studio C# project with a start and cancel button.
There's no Nintex Code and the ASP.Net form only has 2 buttons. The code behind these buttons calls into the SharePoint API.

The form inherits from Microsoft.SharePoint.WebControls.LayoutsPageBase. There are number of methods that you can override. The main ones to notice are the on_click handlers for the 2 buttons on the form.

Generally, you will have a Start Workflow and Cancel button.

 

protected void StartWorkflow_Click(object sender, EventArgs e){


// Optionally, add code here to perform additional steps before starting your workflow

try

{

HandleStartWorkflow();

}

catch (Exception)

{

SPUtility.TransferToErrorPage(SPHttpUtility.UrlKeyValueEncode("Failed to Start Workflow"));

}

}



protected void Cancel_Click(object sender, EventArgs e)

{

SPUtility.Redirect("Workflow.aspx", SPRedirectFlags.RelativeToLayoutsPage, HttpContext.Current, Page.ClientQueryString);

}
The form HTML is quiet simple. It just contains the 2 buttons mentioned above, inside the MainPlaceHolder content node.

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">

<asp:Button ID="StartWorkflow" runat="server" OnClick="StartWorkflow_Click" Text="Start Workflow" />

<asp:Button ID="Cancel" runat="server" OnClick="Cancel_Click" Text="Cancel" />

</asp:Content>
One of the really good features of Visual Studio 2010, is that you can right click on the project and select Package. This will generate a SharePoint Solution file (wsp) for you. Once that is done, you can right click on the project again and select Deploy. This will add the solution to SharePoint and deploy the form to the Layouts and the assembly to the GAC.

I won't be going through the other parts of the project, like features, signing the assembly etc, as the Internet has a bunch of information about that stuff.

Download the Skeleton Start Form - Visual Studio Project

How to use the Custom Start Form

Once the form is deployed, you'll find it in the following location on your servers:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\

My project is named NWInitForm1, so there would be a folder with that name and inside it would be the ASPX file for the form.

Now you can go to one of your lists or libraries, open your workflow in design mode and go to Workflow Settings. Scroll down to the bottom. The 2nd option from the bottom is "Form Type". Here you should select "Custom".
The last option is the path to the form. My form page is name NWInitForm1Page.asmx
So for the path, I put in this:
/_layouts/NWInitForm1/NWInitForm1Page.aspx

Starting a Workflow

When you go to start a workflow:

click on your workflow name (Custom Init Form Workflow in the above screenshot) and you will be provided with your custom developed start form:


Conclusion

My aim here was to show you a really simple start form. Not much coding is required. No calls to the Nintex Workflow api or the web service. All fairly straight forward.

Now that you have a skeleton project to work with, you can start adding more bits to it that you need.

You may want :
1. show item properties that the workflow is about to start on
2. show start data fields that you can enter and pass to the workflow instance
3. display the workflow visualizer
4. show a company logo
etc

 

Posted by Vadim Tabakman Monday, February 6, 2012 7:19:00 PM Categories: Nintex Nintex Workflow Start Form
Copyright Vadim Tabakman
Rate this Content 5 Votes

Comments

Monday, April 30, 2012 5:22:34 AM
Sebastian Duschinger

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Great tutorial! I have another cool tip:

If you have a workflow where you don't have any start variables needed you can just change the start form type to "custom" and leave the "Start page" field empty.

Then the workflow starts silently without showing any start page and any further user interaction needed (the SPLongOperation page is shown though).

 

 

Monday, April 30, 2012 8:05:06 AM

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hey Sebastian,

that's a great idea. Thanks for sharing that.

Tuesday, February 4, 2014 5:21:35 AM
shardul Pasare

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hi,

I able to set start page for nintex workflow to "_layouts/IniWrkflIP.aspx" by selecting custom form in workflow settings as it was our custom code requirement. Is there any drawback or downside of this?
Thanks in advance

Thanks and Regards,

Shardul Pasare

Sunday, February 16, 2014 11:18:27 AM

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Not that I'm aware of Shardul.

Friday, April 18, 2014 3:57:48 PM
Carlos
Gravatar

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hi Mr. Tabakman,

I have created a workflow and start form.  The user fills out the start form and submits.  The flexi task is assigned to users who need to view the start form to approve or reject the request on it.  What type of hyperlink do I need to put int he flexi task notification so the assignees in the flexi task can access the start form to view it?  Thank you.

 

Friday, April 18, 2014 10:12:41 PM

re: Nintex Workflow 2010 - Custom Initiation/Start Form

HI Carlos,

I don't think this is possible.  The start form is used to start a workflow.  IF you've already used it to start the workflow that is running the flexi task, there's no way that I know off, to go back to that start form.

cheers,

Vadim

Monday, April 21, 2014 8:22:40 AM
Carlos
Gravatar

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hi Mr. Tabakman,

In a workflow, if a flexi task fills out a form and attaches files to it, can another flexi task in the workflow use an URL to access the form with the attachments on it, so this flexi task can approve the attachments on this form?  Thank you.

 

Monday, April 21, 2014 11:50:11 PM

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hi Carlos,

I think you'd need to get the urls to the attachments and attach them to the new Flexi Task action.

cheers,

Vadim

Wednesday, August 27, 2014 3:10:16 AM
Rajesh Jha
Gravatar

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Is it possible to access Nintex workflow variables in Custom Start Page in Visual Studio before start of workflow?

If yes, can you please show me an example.

Thanks in advance,

- Rajesh

 

Wednesday, August 27, 2014 7:26:57 AM

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Not that I'm aware of Rajesh.  The initiator form is before a workflow even starts. Even if you could access them, the variable wouldn't contain any data.

cheers,

Vadim

Tuesday, May 12, 2015 2:31:34 PM
Sagir Kazi
Gravatar

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hi Vadim,

I have to send custom notification emails manually when the document/item is updated. The user would select the user(s) (email addresses) from people picker control on the custom initiation aspx page of the workflow. How would I pass these email addresses to the workflow which would send notification emails using the "Send notification" action?

Tuesday, May 12, 2015 3:28:04 PM

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hi Sagir,

create Nintex Workflow variable and check the box to make them Start variables. This will make them appear on the start form.

When the user goes to start the workflow, they fill in the people picker field, the result will go into a workflow variable and then use that variable in the Send Notification action.

cheers,

Vadim

Saturday, July 18, 2015 9:48:29 AM
Devin McMahon
Gravatar

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Vadim,


I am looking to do something similar, in that I have a workflow that simply sends an email report for the specific item. I would like to show the Title or Subject of the Item on the Start Form, just so the user knows they have the right item.

 

Your example stops and then says you may want to "show item properties that the workflow is about to start on", which is exactly what I want to do, but I do not know where to start with that.  Any help you could provide would be appreciated.  I am not a skilled developer by trade, but I just want to make this one adjustment to the start form for this one workflow.

I am on NintexWorkflow for 2013 but I do not have Nintex Forms

 

Thanks

 

Tuesday, October 13, 2015 1:18:21 PM
KP
Gravatar

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Is there any way to display an initiation start form on a workflow that runs on edit ? I have a wf that runs on edit and the user needs to confirm before the edit wf is triggered. Thx!

Thursday, October 15, 2015 9:40:47 AM

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hi KP,

no there isn't.  the On Edit is an event that SP captures and then automatically starts a workflow.

Instead, you need to maybe tweak the item form so that it has the fields you need for the user to confirm.  Then have the Workflow run on-edit, but with a condition to make sure everything you need is in there.

cheers,

vadim

Sunday, February 21, 2016 9:33:47 PM
Dhinesh Kumar J
Gravatar

re: Nintex Workflow 2010 - Custom Initiation/Start Form

Hi Vadim,

        I need a help on customization of Nintex Task Approval page by c# coding. could you please help me to achieve the same. i can send the List Item ID on the URL (Not the Task ID) of my custom page & also it should applicable to this workflow alone. means i don't want customize the form for the entire farm level.

 

Thanks & Regards,

Dhinesh Kumar J. 

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register





 

Statistics

  • Entries (260)
  • Comments (1766)

Categories