ACF Events Codeunit
The codeunit ACF Events contains various triggers that are triggered by events in the Anveo Web Portal. You can equip the trigger with a functionality and adapted for your solution.
The triggers include the following functions of the codeunit ACF Events:
The trigger OnLogin is called when a Anveo User logs into the client.
The trigger OnLogout is called when a Anveo User logs out of the client.
OnLoadEnvironment is called after reloading the user interface in the client (e.g. after pressing F5). This trigger is called immediately after OnLogin.
The trigger OnBeforeLoad is called before loading an Anveo Page Element.
The trigger OnAfterGetField is called after loading a field of an Anveo Page. In this way is it possible to use a finer granularity than when loading a record with OnAfterGetRecord.
The trigger OnAfterGetRecord is called – similar to the same trigger in Microsoft Dynamics NAV 2013R2 – after the complete loading of a record.
The trigger OnAfterLoad is called after the complete loading of an Anveo Page Element.
The trigger OnInit is called before inserting a new record within the client. It can be used to set initial values.
The trigger OnBeforeValidate is called after setting a new value in a field. This call is before the trigger OnValidate on the next page.
The trigger OnValidate is called after validating a field, just like in Microsoft Dynamics NAV 2013R2.
The trigger CallOnInsertTrigger is called when a new record is inserted. Using of the return value of the function can be decided whether then INSERT(TRUE) or INSERT(FALSE) is called in Microsoft Dynamics NAV 2013R2.
The trigger CallOnModifyTrigger is called when a record is modified. Using of the return value of the function can be decided whether then MODIFY(TRUE) or MODIFY(FALSE) is called in Microsoft Dynamics NAV 2013R2.
The trigger CallOnDeleteTrigger is called when a record is deleted. Using of the return value of the function can be decided whether then DELETE(TRUE) or DELETE(FALSE) is called in Microsoft Dynamics NAV 2013R2.
The trigger OnInsertRecord is called on inserting a new record and can be used to enhance the Microsoft Dynamics NAV 2013R2 trigger OnInsertRecord Microsoft Dynamics NAV 2013R2 with additional functionality.
The trigger OnModifyRecord is called on modifying a record and can be used to enhance the Microsoft Dynamics NAV 2013R2 trigger OnModifyRecord Microsoft Dynamics NAV 2013R2 with additional functionality.
The trigger OnRenameRecord is called on changing a field within the primary key of a record and can be used to enhance the Microsoft Dynamics NAV 2013R2 trigger OnRenameRecord Microsoft Dynamics NAV 2013R2 with additional functionality.
The trigger OnDeleteRecord is called on deleting a record and can be used to enhance the Microsoft Dynamics NAV 2013R2 trigger OnDeleteRecord Microsoft Dynamics NAV 2013R2 with additional functionality.
The trigger OnAfterInsertRecord is called after successfully inserting a record into the database.
The trigger OnAfterModifyRecord is called after successfully modifying a record of the database.
The trigger OnAfterRenameRecord is called after successfully modifying a field within the primary key of a record.
The trigger OnAfterDeleteRecord is called after successfully deleting a record of the database.
The trigger OnAction is called after pressing a menu item or button. All actions that can be activated via menu items or buttons are defined here. The following functions of the Anveo Client Suite are located there as standard defaults:
The action CLOSE_WEBPAGE() closes the current Anveo Page the action is called in.
The action SAVE_RECORD() saves the current record in Microsoft Dynamics NAV 2013R2.
The action NEW_RECORD() inserts a new record on the current Anveo Page.
The action NEW_RECORD_WEBPAGE() opens a linked Anveo Page and inserts a new record into the database. The opened Anveo Page shows the new record.
The action DELETE_VIRTUAL_TBL() deletes all data of a virtual table shown on the current Anveo Page Element. This action can be used to reset search masks.
The action DELETE_ALL_V_TBLS() deletes all data of all virtual tables shown on the current Anveo Page.
The action REC_INFO() shows the current information and filter of a record in a message box.
The action PREVREC() jumps to the previous record and shows that record on the current Anveo Page.
The action NEXTREC() jumps to the next record and shows that record on the current Anveo Page.
As per convention, all internal functions of Anveo Client Suite are equipped with a pair of parentheses () at the end of the name. These function names should not be changed under any circumstances.
The trigger OnBeforeCloseAnveoPage is called before closing an Anveo Page.
Besides the trigger the following functions of codeunit ACF Events are also important:
The time when a record should be written into the database can be defined here. This works only for Anveo Page Elements setup with the Write Behavior Defined. Find more information about this setup here.
All of the own table relations are defined within the function CustomAnveoPageRelation. The function ends with the return of an RecRef which has filter set.
In the function DropDownFieldDefinition fields (maximum of 2) can be defined which should be displayed in a drop-down that refers to a certain table. For example, in the block DATABASE::Item in codeunit ACF Events the field numbers are defined which should be displayed when a drop-down is implemented in a field that refers to an item (table #18). In the example the number (Item.FIELDNO(“No.”)) and the description (Item.FIELDNO(“Description”)) is displayed to identify an item in the dropdown list.
The function GetLanguageFilter returns a filter string that represents all languages that can be chosen in the client connected to Anveo Client Suite. As a standard default these are the language codes DEU (German, Germany) and ENU (English, USA).
The function ReadSecurityFilter allows the definition of security filters. These security filters depend on the fields Relation Type and Relation Code of the Anveo User. Find out more about the Anveo User setup here.
Using the function Checkpassword you can use C/AL code to stipulate the password guidelines for client users, for instance that a password must include special characters or be a certain length.
The function TestPassword tests a given password using the Checkpassword function and reports an error when the password does not comply with the guidelines.