Linking and compiling to an agency object

  1. Navigate to the Enhancement\Config subdirectory and open the AgencyPersonalization.config file. This XML file contains all compiled Content Manager links and client defined business objects.
  2. Find the desired product family in the <COMPFILES> xml tag.
    <COMPFILES>
       <FAMILY name="AssetManagementTest" owner="Hansen8 dl="AssetManagementTest000.dll" />
       <FAMILY name="CodeTest" owner="Hansen8" dll="CodeTest002.dll" />
       <FAMILY name="Test" owner="Hansen8" dll="Test000.dll" />
    </COMPFILES>
    The dll attribute specifies the latest assembly for the product family.
  3. Reference the agency assembly inside your Visual Studio project
    referencing the agency assembly
  4. Add the method signature to your extension method, just as you would for a standard Infor Public Sector business object.
    /// <summary>
    /// Sample method to show how to call an agency dll
    /// </summary>
    /// <param name="codeComponent">Enhanced agency component</param>
    /// <returns>Result structure</returns>
    public Result BeforeAddAgency (Hansen8.CodeTest.CodeExternalExample code Component)
    {
    

You can now compile your Visual Studio project and move to the next step of the process.

Note: Agency business objects are compiled with a unique numbering convention, such as MyDll004. This ensures that the latest code is always used in a running .Net application. To ensure all extensions are in sync, the dll reference must be verified in Visual Studio before promoting to production.