ACF Events Codeunit
The codeunit ACF Events contains various triggers that are triggered by events in the Anvaigo Mobile App. 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 Anvaigo User logs into the client.
OnLogout
The trigger OnLogout is called when a Anvaigo User logs out of the client.
OnLoadEnvironment
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 Anvaigo Page Element.
The trigger OnAfterGetField is called after loading a field of an Anvaigo 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 Dynamics – after the complete loading of a record.
The trigger OnAfterLoad is called after the complete loading of an Anvaigo 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.
OnValidate
The trigger OnValidate is called after validating a field, just like in Dynamics.
CallOnInsertTrigger
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 Dynamics.
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 Dynamics.
CallOnDeleteTrigger
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 Dynamics.
The trigger OnInsertRecord is called on inserting a new record and can be used to enhance the Dynamics trigger OnInsertRecord Dynamics with additional functionality.
The trigger OnModifyRecord is called on modifying a record and can be used to enhance the Dynamics trigger OnModifyRecord Dynamics 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 Dynamics trigger OnRenameRecord Dynamics with additional functionality.
The trigger OnDeleteRecord is called on deleting a record and can be used to enhance the Dynamics trigger OnDeleteRecord Dynamics with additional functionality.
The trigger OnAfterInsertRecord is called after successfully inserting a record into the database.
OnAfterModifyRecord
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 Anvaigo Client Suite are located there as standard defaults:
The action CLOSE_WEBPAGE() closes the current Anvaigo Page the action is called in.
The action SAVE_RECORD() saves the current record in Dynamics.
The action NEW_RECORD() inserts a new record on the current Anvaigo Page.
The action NEW_RECORD_WEBPAGE() opens a linked Anvaigo Page and inserts a new record into the database. The opened Anvaigo Page shows the new record.
The action DELETE_VIRTUAL_TBL() deletes all data of a virtual table shown on the current Anvaigo 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 Anvaigo 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 Anvaigo Page.
The action NEXTREC() jumps to the next record and shows that record on the current Anvaigo Page.
As per convention, all internal functions of Anvaigo 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.
OnBeforeCloseAnvaigoPage
The trigger OnBeforeCloseAnvaigoPage is called before closing an Anvaigo Page.
Besides the trigger the following functions of codeunit ACF Events are also important:
IsWriteBack
The time when a record should be written into the database can be defined here. This works only for Anvaigo Page Elements setup with the Write Behavior Defined. Find more information about this setup here.
CustomAnvaigoPageRelation
All of the own table relations are defined within the function CustomAnvaigoPageRelation. The function ends with the return of an RecRef which has filter set.
DropDownFieldDefinition
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.
GetLanguageFilter
The function GetLanguageFilter returns a filter string that represents all languages that can be chosen in the client connected to Anvaigo Client Suite. As a standard default these are the language codes DEU (German, Germany) and ENU (English, USA).
ReadSecurityFilter
The function ReadSecurityFilter allows the definition of security filters. These security filters depend on the fields Relation Type and Relation Code of the Anvaigo User. Find out more about the Anvaigo User setup here.
Checkpassword
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.
TestPassword
The function TestPassword tests a given password using the Checkpassword function and reports an error when the password does not comply with the guidelines.