Events of the VAPS
OnBeforeTransfer events
These events can be used to modify Business Central data before transferring them into our simulation data. Not only simple modifications are possible, but also complex ones such as the application of flowFields/Flowfilters and thus execution of self-created or already existing formulas. The changes will not be saved in the Business Central data.
The events in detail:
OnBeforeTransferMachineCenter
This event occurs on loading a machine center
[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]
procedure OnBeforeTransferMachineCenter(var pMachineCenterRecord:
Record “Machine Center”; var pHandled: Boolean)
|
Data type |
Description |
var pMachineCenterRecord |
Record |
The machine center to be loaded. |
var pHandled |
Boolean |
The event will be handled if it returns true |
OnBeforeTransferProdOrder
This event occurs on loading a production order.
[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]
procedure OnBeforeTransferProdOrder(var pProdOrderRecord:
Record “Production Order”; var pHandled: Boolean)
|
Data type |
Description |
var pProdOrderRecord |
Record |
The production order to be loaded. |
var pHandled |
Boolean |
The event will be handled if it returns true |
OnBeforeTransferProdOrderLine
This event occurs on loading a production order line.
[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]
procedure OnBeforeTransferProdOrderLine(var pProdOrderLineRecord:
Record “Prod. Order Line”; var pHandled: Boolean)
|
Data type |
Description |
var pProdOrderLineRecord |
Record |
The production order line to be loaded. |
var pHandled |
Boolean |
The event will be handled if it returns true |
OnBeforeTransferProdOrderRoutingLine
This event occurs on loading a production order routing line.
[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]
procedure OnBeforeTransferProdOrderRoutingLine(var pProdOrderRoutingLineRecord:
Record “Prod. Order Routing Line”; var pHandled: Boolean)
|
Data type |
Description |
var pProdOrderRoutingLineRecord |
Record |
The production order routing line to be loaded. |
var pHandled |
Boolean |
The event will be handled if it returns true |
OnBeforeTransferWorkCenter
This event occurs on loading a work center.
[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]
procedure OnBeforeTransferWorkCenter(var pWorkCenterRecord:
Record “Work Center”; var pHandled: Boolean)
|
Data type |
Description |
var pWorkCenterRecord |
Record |
The work center to be loaded. |
var pHandled |
Boolean |
The event will be handled if it returns true |
OnBeforeTransferWorkCenterGroup
This event occurs on loading a work center group.
[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]
procedure OnBeforeTransferWorkCenterGroup(var pWorkCenterGroupRecord:
Record “Work Center Group”; var pHandled: Boolean)
|
Data type |
Description |
var pWorkCenterGroupRecord |
Record |
The work center group to be loaded. |
var pHandled |
Boolean |
The event will be handled if it returns true |
OnPostPublishSimulation()
This event occurs after a simulation got published.
Example:
[EventSubscriber(ObjectType::Codeunit,
Codeunit::"NETVAPS IntegrationMgmt", 'OnPostPublishSimulation', '', false, false)]
local procedure handleOnPostPublishSimulation()
begin
//code to handle event
end;
Prod. Order Routing Line Editable
With this event, the user can prevent a production order routing line from being edited. The event will be thrown in the load/reload phase of a VAPS simulation. If the event is not handled, the standard setting of ediatble = true will be applied.
Example:
All operations of work center 400 get "protected".
[EventSubscriber(ObjectType::Codeunit, Codeunit::"NETVAPS IntegrationMgmt",
'OnProvideProdOrderRoutingLineEditability', '', false, false)]
local procedure handleOnProvideProdOrderRoutingLineEditability(pClientGuid: Guid;
pProdOrderRoutingLinePosition: Text; var pEditable: Boolean; var pHandled: Boolean)
var
_porlRecord: Record "Prod. Order Routing Line";
_count: Integer;
begin
_porlRecord.SetRange("Work Center No.", '400');
_porlRecord.SetPosition(pProdOrderRoutingLinePosition);
if _porlRecord.Find('=') then begin
pEditable := false;
pHandled := true;
end;
end;
|
Data type |
Description |
pProdOrderRoutingLinePosition |
Text |
The production order routing line to be set to "uneditable". |
var pEditable |
Boolean |
The production order routing will be set to "uneditable" if it returns "false". |
var pHandled |
Boolean |
The event will be handled if it returns true |