Custom Extension
In order to take advantage of some of the advanced functionality ShopFloor Offers you may be required to build your own custom extension. Most Business Central partners will be able to help you do this, or you will require the assistance of a Business Central AL programmer.
(info box)
You can read more about developing for Microsoft Business Central on this Microsoft Learn link
Basing your extension on NAVEKSA ShopFloor
In order for your application to be able to see the integration events from ShopFloor you have to base your application on the ShopFloor application.
In your Extension you will need to refer to the ShopFloor App as a dependency in the app.json file. To do so, open the app.json file and add a depencency to the ShopFloor application like this:
"dependencies": [
{
"id": "bb075128-50ee-40a7-9234-e51a99b45426",
"name": "NAVEKSA ShopFloor 365",
"publisher": "NAVEKSA",
"version": "225.09.02.02"
} ]
Subscribing to an event
In order to subscribe to an event, you will have to create an event subscriber.
To create an event subscriber method
1. Decide which codeunit to use for the event subscriber method. You can create a new codeunit or use an existing one.
2. Add an AL method to the codeunit.
We recommend that you give the method a name that indicates what the subscriber does, and has the format [Action][Event]. [Action] is text that describes what the method does. [Event] is the name of the event publisher method to which it subscribes.
3. Add code to the method for handling the event.
4. Decorate the event subscriber method with the EventSubscriber attribute. See the following example code for the syntax.
[EventSubscriber(ObjectType::, , ‘‘, ‘‘, , )]
5. Optionally, set the codeunit’s EventSubscriberInstance property to specify how the event subscriber method will be bound to the instance of this codeunit.
Example of event subscriber
The following is an example of subscribing to the event “OnPostCapEntryBeforeOutputJnlPostWithCapEntry” in the codeunit 6170474 – “NAVEKSA SFS Post Entries”.
[EventSubscriber(ObjectType::Codeunit, Codeunit::“NAVEKSA SFS Post Entries”, ‘OnPostCapEntryBeforeOutputJnlPostWithCapEntry’, ‘’, true, true)]
procedure CalculatingCustomRunTime(var OutputJnl: Record "Item Journal Line"; ShopFloorCapEntry: Record "NAVEKSA SFS Cap. Ledger Entry")
var
begin
//Your custom code goes here.
//...
//Custom calculations
//...
//Set OutputJnl values here
//...
end;