Writing code
Before coding your external assembly, a reference to Core.dll must be added to the Visual Studio project. Core.dll is located in the bin folder, a subfolder of the Infor Public Sector application directory. After adding the Core.dll
reference, a directive must be added to the class. In C# the keyword for adding a
directive is using
and would look like this: using Hansen.Core
. Visual Basic's keyword is Imports
:
Imports Hansen.Core
Each business object has an event signature. The signature format is below:
Result AnyNameHere(BusinessObjectSpecificInterface variableName)
A signature refers to the return type and the parameters list of the method. Example:
public Result ExternalDLLDemo(Hansen.Inventory.IPartCatalog catalog)
{
string temp;
Result res = MyBeforeAddLogic(catalog, true, out temp);
return res;
}
The return type will always be Result
. Result
is an internal Hansen structure that is used throughout the system. Its purpose is to
report the result of the executing method.
After the method signature is established any computation or activities can be executed from the method.
In the above code Hansen.Inventory.IPartCatalog
is the business object that the method is
expecting, so this method can only be used with the PartCatalog
business object. Upon deployment, trying to associate this
method with any other business object will result in an error.