What are inline functions?
Inline functions are used within Nintex Forms to perform a variety of different operations performed on the Server. Custom inline functions can be created within Visual Studio for use within Nintex Forms. In this article, we demonstrate how you can create additional custom inline functions for use in Nintex Forms (2013 and 2010).
A custom inline function may be able to leverage functionality from the .NET library. One such example is generating a Random number for use within a form with the .NET library Random number generator.
Once you have created a new inline function it will be available in the Insert Reference dialog of Nintex Forms controls.
- All versions of Nintex Forms
- Any version of Visual Studio with .NET 3.5
The requirements for a function to be used by Nintex Forms are:
- The function must be a static method
- The function accepts parameters that can be parsed from text
- The assembly is signed and built as a Strongly Named assembly
- The function is contained in a type installed into the GAC on each web front end
A function is referred to by its alias. A function can have multiple aliases to cater for localization. Localization of function names is done by adding a new alias for each language.
Creating an Inline Function - Random Number Generator
In this article, we’re going to step you through how to create a random number generator function. You may use this in cases where an unpredictable result is desired.
- Create a new class project in Visual Studio. In the Application section, select .NET Framework 3.5 as the Target framework.
- Sign the Assembly. Open the Signing section, and supply your strong name key file, or create a new one.
- Within Visual Studio, create a Static class with a static method. In this example we will create a Random function which will return a random number.
- Compile the project within Visual Studio.
public static class InlineFunctions
public static int Random()
Random randomNumber = new Random(Environment.TickCount);
- Register the output dll to the GAC using the gacutil utility.
gacutil /i "C:\Projects\CustomInlineFunction\bin\Release\CustomInlineFunction.dll"
- Add the inline function to Nintex Forms via the PowerShell command Add-InlineFuction.
Add-InlineFunction -FunctionAlias "fn-CustomRandom" -AssemblyName "CustomInlineFunction, Version=22.214.171.124, Culture=neutral, PublicKeyToken=c559cde2944155fd" -Namespace "CustomInlineFunction " -TypeName "InlineFunctions" -MethodName "Random" -Usage "fn-CustomRandom()" -Description "Returns a random number"
- The function should now be available in Nintex Forms.
How to access the Custom Inline Function:
Click on any field with an Insert Reference icon, select the Inline Functions tab, and the new inline function should appear in the list.