The following question was recently asked:
I am a developer working in my Sage assigned module and I need to invoke a finder from one of the standard Sage modules (i.e. AR, AP, GL, etc.). How do I do this?
This article will illustrate the steps required to invoke a finder from a module other than what is currently being developed.
To illustrate the steps involved in adding a finder from another module, I have run the solution and code generation wizards and have created the TU Payment Codes setup screen. This screen is based upon the AR Payment Codes business view (AR0012) and only contains the key field and finder as generated from the wizards. For this example, I am going to want a finder for a vendor (just because it’s from another module).
In this step, I need to locate the name for the Vendor Finder. The finder name is a descriptive field used to register the finder with Unity for dependency injection. The name is found in the Sage.CA.SBS.ERP.Sage300.Common.Plugin.Finder.js file. This file is located in the Areas\Core\Scripts folder of the Web project:
The value “vendor” as this will be used later in the setFinder method.
In this step, I need to add the required references to the AP binaries in the Web project in order for the finder to be invoked.
Finders for all modules have already been registered with Unity.
The AP binaries are located in your Sage 300 Online\Web\bin folder.
The following binaries will be added if they do not exist or have not been previously added:
In this step, I will add the controls to the razor view.
This example will not be bound to the data model as it is only being added to demonstrate invoking another finder and not data binding
In this step, I will add the required localization variables to the _Localization.cshtml partial view.
As we begin to implement the customization framework, we will investigate the notion of externalizing the Unity Registrations into external XML files and therefore the discovery performed in Step One of this article will be simplified.