API

Events

Events of the VPS

DoSkipWorkCenterOnDataLoad

This event allows the customer to prevent (skip) the loading of certain workcenters into the simulation during the load/reload phase. Subordinate or connected elements will then also not be loaded into the simulation.

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)] 

procedure DoSkipWorkCenterOnDataLoad(pClientGuid: Guid; 

var pWorkCenter:Record "Work Center"; var pSkip: Boolean; 
var pHandled: Boolean)

 

 

Data type

Description

Parameter:

pClientGuid


Guid


This value is used for the global identification of VPS Control-AddIn on a page.

 

var pWorkCenter

Record 

Determines which record will be skipped.

var pSkip

Boolean

Determines whether records will be skipped or not.

var pHandled

Boolean

If it returns true, the event will be skipped

OnAfterProdOrderRoutingLineSelectionChange

This event occurs when one or more production order routing lines get selected.

Please note: Multiselect is not officially released but can be unlocked by knowledgeable customers.

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]

procedure OnAfterProdOrderRoutingLineSelectionChange(pClientGuid: Guid; 

pProdOrderRoutingLinePositions: List of [Text]; var pHandled: Boolean)

 

Data type

Description

Parameter:

 

 

pClientGuid

Guid

This value is used for the global identification of VPS Control-AddIn on a page.

pProdOrderRoutingLinePositions

List of [Text]

List of selected production order routing lines. By default, there is one production order routing line. In the future, in case of multi-selection, several Production Order Routing Lines will be selected

var pHandled

Boolean

If it returns true, the event will be skipped

OnAfterSaveProdOrderRoutingLine

This event occurs after saving a production order routing line. 

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)] 

procedure OnAfterSaveProdOrderRoutingLine(pClientGuid: Guid;  

var pProdOrderRoutingLineRecordOriginalTemp: Record “Prod. Order Routing Line” temporary;   

var pProdOrderRoutingLineRecordAfterTemp: Record “Prod. Order Routing Line” temporary) 

 

Data type

Description

Parameter:

 

 

pClientGuid

Guid

This value is used for the global identification of VPS Control-AddIn on a page.

var pProdOrderRoutingLineRecordOriginalTemp

Record

The original production order routing line. 

var pProdOrderRoutingLineRecordAfterTemp 

Record

The after save production order routing line. 

//do anything in bc here what has to be done after VPS modified porl is saved to BC;

OnBeforeSaveProdOrderRoutingLine

This event occurs before saving a production order routing line. 

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)] 

procedure OnBeforeSaveProdOrderRoutingLine(pClientGuid: Guid;  

var pProdOrderRoutingLineRecordOriginalTemp: Record “Prod. Order Routing Line”  temporary;  

var pProdOrderRoutingLineRecordBeforeTemp: Record “Prod. Order Routing Line”  temporary) 

 

Data type

Description

Parameter:

 

 

pClientGuid

Guid

This value is used for the global identification of VPS Control-AddIn on a page.

var pProdOrderRoutingLineRecordOriginalTemp

Record

The original production order routing line. 

var pProdOrderRoutingLineRecordBeforeTemp 

Record

The before save production order routing line. 

//do stuff here that has to be done before porl is saved to bc (for example move dependend lines for reservations)

OnBeforeScheduleProdOrderRoutingLine 

This event occurs before scheduling a production order routing line. 

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)] 

procedure OnBeforeScheduleProdOrderRoutingLine(pClientGuid: Guid;  

var pProdOrderRoutingLineRecordOriginalTemp: Record “Prod. Order Routing Line”  temporary;  

var pProdOrderRoutingLineRecordBeforeTemp  temporary;  

var pCancel:  Boolean; var pHandled:  Boolean ) 

 

Data type

Description

Parameter:

 

 

pClientGuid

Guid

This value is used for the global identification of VPS Control-AddIn on a page.

var pProdOrderRoutingLineRecordOriginalTemp

Record

The original production order routing line. 

var pProdOrderRoutingLineRecordBeforeTemp 

Record

The before scheduled production order routing line. 

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.

For more details on the events see here.

The events in detail:

OnBeforeTransferMachineCenter

This event occurs on loading a machine center

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]

procedure OnBeforeTransferMachineCenter(pClientGuid: Guid; 
var pMachineCenterRecord: Record “Machine Center”; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

pClientGuid

 

Guid

 

This value is used for the global identification of VPS Control-AddIn on a page.

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(pClientGuid: Guid; 
var pProdOrderRecord: Record “Production Order”; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

pClientGuid

 

Guid

 

This value is used for the global identification of VPS Control-AddIn on a page.

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(pClientGuid: Guid; 
var pProdOrderLineRecord: Record “Prod. Order Line”; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

pClientGuid

 

Guid

 

This value is used for the global identification of VPS Control-AddIn on a page.

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(pClientGuid: Guid; 
var pProdOrderRoutingLineRecord: Record “Prod. Order Routing Line”; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

pClientGuid

 

Guid

 

This value is used for the global identification of VPS Control-AddIn on a page.

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(pClientGuid: Guid; 
var pWorkCenterRecord: Record “Work Center”; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

pClientGuid

 

Guid

 

This value is used for the global identification of VPS Control-AddIn on a page.

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(pClientGuid: Guid; var pWorkCenterGroupRecord: Record “Work Center Group”; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

pClientGuid

 

Guid

 

This value is used for the global identification of VPS Control-AddIn on a page.

var pWorkCenterGroupRecord

Record

The work center group to be loaded.

var pHandled

Boolean

The event will be handled if it returns true

OnProdOrderRoutingLineCustomFunction

This event can be used, for example, to execute custom code in a context related to a production order routing line. The context is determined by the parameter pContext. (e.g. in the context menu of the Capacity View). See also "OnProvideProdOrderRoutingLineCustomFunctions".

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]

procedure OnProdOrderRoutingLineCustomFunction(pClientGuid: Guid; 

pProdOrderRoutingLinePosition: Text; pCustomFunctionKey:  Text; 

pContext: Option; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

 

 

pClientGuid

Guid

This value is used for the global identification of VPS Control-AddIn on a page.

pProdOrderRoutingLinePosition

Text

List of selected production order routing lines. By default, there is one production order routing line. In the future, in case of multi-selection, several Production Order Routing Lines will be selected

pCustomFunctionKey

Text

Specifies the context menu item.

pContext

Option

Describes the context menu item in more detail.

var pHandled

Boolean

If it returns true, the event will be skipped

OnProvideAdditionalDateLine

This event, which is triggered during the (re)loading phase, can be used to configure an additional dateline that is not bound to an object. If the event is handled and a DateTime is specified, the line is shown, otherwise a possibly existing line is removed (at reload). If no values are specified for parameters that describe the appearance of the line, the default of the ControlAddin results.

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]

procedure OnProvideAdditionalDateLine(pClientGuid: Guid; var pDateLineDateTime: DateTime;
var pDescription: text; var pColor: text; var pDescriptionColor: text;
var pThickness: integer; var pDashArray: text; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

 

 

pClientGuid

Guid

This value is used for the global identification of VPS Control-AddIn on a page.

 

var pDateLineDateTime

DateTime

Date of the additional date line 

var pDescription

Text

Description of the additional date line 

var pColor

Text

Color of the additional date line 

var pDescriptionColor

Text

Color of the description of the additional date line 

var pThickness

Integer

Line thickness of the additional date line

var pDashArray

Text

Dash of the additional date line 

var pHandled

Boolean

If it returns true, an already existing date line is removed (reload)

OnProvideProdOrderLineAdditionalDateLine

This event, which is triggered during the loading phase, can be used to configure an additional dateline for a production order line in the Capacity View. This date line will be displayed when selecting your ProductionOrderRoutingLine.

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]

procedure OnProvideProdOrderLineAdditionalDateLine(pClientGuid: Guid; 

pProdOrderLinePosition: Text; var pDateLineDateTime: DateTime; 

var pDescription:  Text; var pColor:  Text; var pDescriptionColor: Text; 
var pThickness: integer; var pDashArray:  Text; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

 

 

pClientGuid

Guid

This value is used for the global identification of VPS Control-AddIn on a page.

 

pProdOrderLinePosition

Text

Position of a selected production order routing line.

var pDateLineDateTime

DateTime

Date of the additional date line of a production order line.

var pDescription

Text

Description of the additional date line of a production order line.

var pColor

Text

Color of the additional date line of a production order line.

var pDescriptionColor

Text

Color of the description of the additional date line of a production order line.

var pThickness

Integer

Line thickness of the additional date line of a production order line.

var pDashArray

Text

Dash of the additional date line of a production order line.

var pHandled

Boolean

If it returns true, the event will be skipped

OnProvideProdOrderRoutingLineColor

This event occurs when, upon loading/reloading the data from Business Central, color and text color of the bars are configured individually. This applies to the Production Order View and the Capacity View. If the pHandled parameter is set to false, the default color is set.

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]

procedure OnProvideProdOrderRoutingLineColor(pClientGuid: Guid; 

pProdOrderRoutingLinePosition: Text; var pBarColor: Text; 

var pTextColor: Text; var pHandl ed: Boolean)

 

 

Data type

Description

Parameter:

 

 

pClientGuid

Guid

This value is used for the global identification of VPS Control-AddIn on a page.

 

pProdOrderRoutingLinePosition

Text

Position of a selected production order routing line.

var pBarColor

Text

Specifies the bar color.

var pTextColor

Text

Specifies the text color.

var pHandled

Boolean

If it returns true, the event will be skipped

OnProvideProdOrderRoutingLineCustomFunctions

This event allows the customer to "register" custom code or functionality on production order routing lines. This functionality can then be executed via the OnProdOrderRoutingLineCustomFunction event. (Example: a custom functionality on the context menu of a production order line in the Capacity View), see also OnProdOrderRoutingLineCustomFunction.

[IntegrationEvent(/*IncludeSender*/false, /*GlobalVarAccess*/false)]

procedure OnProvideProdOrderRoutingLineCustomFunctions

(pCustomFunctionsKeysAndDescriptions: Dictionary of [Text, Text]; 

pContext: Option; var pHandled: Boolean)

 

 

Data type

Description

Parameter:

 

 

pCustomFunctionsKeysAndDescriptions

Dictionary of [Text, Text]

List with keys and descriptions of context menu items.

pContext

Option

More precise description of context menu item.

var pHandled

Boolean

If it returns true, the event will be skipped.

Example:

 [EventSubscriber(ObjectType::Codeunit, Codeunit::"NETVPS IntegrationMgmt", 'OnProvideProdOrderRoutingLineCustomFunctions', '', false, false)]

    local procedure handleOnProvideProdOrderRoutingLineCustomFunctions(pCustomFunctionsKeysAndDescriptions: Dictionary of [Text, Text]; pContext: Option; var pHandled: Boolean)

    var

        _integrationMgmt: Codeunit "NETVPS IntegrationMgmt";

    begin

            case pContext of

                _integrationMgmt.getProdOrderRoutingLineCustomFunctionContext() ::contextMenuProdOrderView:

                  // additional contextmenu items for Porl contextMenu in ProdOrderView

                    begin

                        pCustomFunctionsKeysAndDescriptions.Add('customFunction1', 'customProdOrderViewFunction 1');

                        pCustomFunctionsKeysAndDescriptions.Add('separator1', '-----------------------------------------------');

                        pCustomFunctionsKeysAndDescriptions.Add('customFunction2', 'customProdOrderViewFunction 2');

                        pCustomFunctionsKeysAndDescriptions.Add('separator2', '-----------------------------------------------');

                        pCustomFunctionsKeysAndDescriptions.Add('customFunction3', 'customProdOrderViewFunction 3');

                    end;




                _integrationMgmt.getProdOrderRoutingLineCustomFunctionContext() ::contextMenuCapacityView:

                    Begin

// additional contextmenu items for Porl contextMenu in CapacityView

                        pCustomFunctionsKeysAndDescriptions.Add('customFunction1', 'customCapacityViewFunction 1');

                        pCustomFunctionsKeysAndDescriptions.Add('separator1', '-----------------------------------------------');

                        pCustomFunctionsKeysAndDescriptions.Add('customFunction2', 'customCapacityViewFunction 2');

                        pCustomFunctionsKeysAndDescriptions.Add('separator2', '-----------------------------------------------');

                        pCustomFunctionsKeysAndDescriptions.Add('customFunction3', 'customCapacityViewFunction 3');

                    end;

            end;

            //important!!! pHandled must be true in order the settings to be handled in VPS

            pHandled := true;

    end;