Nintex Workflow – Custom Inline Function

Hi everyone. Today I want to show you how you can develop custom inline functions for the Nintex Workflow product for SharePoint.

I got the idea from here (Absolutely great post.) but I created a SharePoint solution file because I thought this would be a bit simpler to use.

First open Microsoft Visual Studio and create a new Empty SharePoint Project. Remember to deploy it as a farm solution.


Now add a new Class. I called mine “Function.cs”.


Here is some example code I added to my class. (I got the code also from here.)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CustomNintexInline
class Function
public static int Random()
Random rnd = new Random(Environment.TickCount);
return rnd.Next();

public static int Random(int _iMax)
Random rnd = new Random(Environment.TickCount);
return rnd.Next(_iMax);

public static int Random(int _iMin, int _iMax)
Random rnd = new Random(Environment.TickCount);
return rnd.Next(_iMin, _iMax);

Now build your project.

After you successfully built your project run cmd as Administrator and go to the following path:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin

Next run the following code to retrieve the Public key token:

sn.exe -T "Path-To-Your-dll/Project.dll"

Write down the value of your Public key token you will need it later.


Next you need to add your solution file to your SharePoint Farm. Do this by running PowerShell as Administrator and by running the following commands:

Add-PSSnapin Microsoft.SharePoint.PowerShell
Add-SPSolution "Full-Path-To-Your-WSP/Project.wsp"


Next open your SharePoint Central Administration and deploy your solution globally.


Next go to:

C:\Program Files\Nintex\Nintex Workflow 2010

Now run cmd as Administrator and run the following code to add your custom inline function to your Nintex Workflow product:

NWAdmin.exe -o addinlinefunction -functionalias "fn-Random (The string alias used to use your function later in your workflows)" -assembly "CustomNintexInline, Version=,  Culture=neutral, PublicKeyToken=<Value you retrieved before by using sn.exe> (dll data)" -namespace "CustomNintexInline (Namespace of your Project)" -typename "Function (Class of your Project containing your function)" -method "Random (Method/Function name in your Project)" -description "<A short description what your function does>" -usage "<How to use your function>"

If the above command finishes without error messages your custom inline function has been successfully added to your Nintex Workflow product.


Next run cmd as Administrator and run the following command to restart IIS:


That´s it. Now your custom inline function should be available. To test it I created a simple Nintex Workflow:


When you go to Inline Functions in one of your Nintex Workflow Actions you will find your custom inline function. (Called “Random” in my example)


Here you can see the result of my Test workflow:


As you can see everything worked as expected and your custom inline function is ready to use. I hope you liked my today´s post. See you next time.

As always you can download my code from here.


Tagged ,

One thought on “Nintex Workflow – Custom Inline Function

  1. ysrysmwtq says:

    Nintex Workflow – Custom Inline Function | theezitguy

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: