With the release of Impact 4.2 (build 117) you can now run compiled custom code from the data-entry form button control. This code can be written in VisualBasic or VisualCSharp. You will need to build a DLL using Visual Studio 2008 or better.
Create the DLL
In the VS project create a new class as shown below and compile into a DLL.
PublicClass SDKExample
PublicSharedFunction RunCustomCode(ByVal form As Durkin.Common.Classes.frmSubEntityItemEditDurkin) AsBoolean
System.Diagnostics.Debugger.Break()
ReturnTrue
EndFunction
End Class
Installing the DLL
To install your custom dll please follow these steps:
Close ACT!
Copy your DLL into the plugin folder
Restart ACT
The ACT plugin folder is either at one of these two locations:
C:\Program Files (x86)\ACT\Act for Windows\Plugins ( 64 bit machine)
C:\Program Files\ACT\Act for Windows\Plugins(32 bit machines)
Calling the DLL code:
To call you custom code you need to add a button onto your form and set the buttons properties to match your; DLL Name, Class and method. Please follow these steps:
Open you form in the designer
Change the drop down at the top of the toolbox to "Controls - Specialized"
Drag the BUTTON [DLL INVOKE] onto your form
On the 'Custom Properties' panel change these properties
Set the dllclass property to Durkin.Custom.RunCustomCode.SDKExample
Set the dllfilename property to Durkin.Custom.RunCustomCode.dll