ACF Management Codeunit
Using the codeunit ACF Management you have the ability to invoke the main control functions of the Anveo Client Suite and use in their code.
The web services utilized for communication with Microsoft Dynamics NAV 2009R2 do not permit any interaction with the user in the Anveo Web Portal due to technical reasons. As a result, the Microsoft Dynamics NAV 2009R2 functions MESSAGE, CONFIRM, STRMENU and DIALOG are not automatically identified and displayed in the client. On the other hand, these predefined constraints stipulated by the web services can be circumvented with little effort by transferring these invocations to the codeunit ACF Management. The codeunit makes the case differentiation between Microsoft Dynamics NAV 2009R2 Client and Anveo Client Suite automatically and processes the case accordingly.
Error messages caused by ERROR do not have to be adapted, the web service can handle these.
The function MESSAGE is equivalent to the same function in Microsoft Dynamics NAV 2009R2. You can use messages, in which you replace the code:
MESSAGE('Hello World!'); MESSAGE('Hello %1!', anyVariable);
with this code:
ACFManagement.MESSAGE('Hello World!'); ACFManagement.MESSAGE1('Hello %1!', anyVariable);
The function MESSAGE1 means that it contains a parameter that is embedded in the message box text. By activating the functions MESSAGE …MESSAGE10 you can specify up to 10 parameters.
In the event that you require interaction with the user via a CONFIRM message, then you can replace the code:
IF CONFIRM('Are you sure?') THEN doSomething(); IF CONFIRM('Do you want to delete %1?',anyVariable) THEN doSomething();
with this code:
IF ACFManagement.CONFIRM('Are you sure?',TRUE) THEN doSomething(); IF ACFManagement.CONFIRM1('Do you want to delete %1?',FALSE, anyVariable) THEN doSomething();
Analogous to the messages, by activating CONFIRM ... CONFIRM10 you can specify up to 10 parameters. Please note that you have to specify the parameter Default, that parameter can be omitted in the CONFIRM of Microsoft Dynamics NAV 2009R2.
As with the Microsoft Dynamics NAV 2009R2 default version, with a CONFIRM attention should be paid that no table has been blocked in advance with INSERT, MODIFY, DELETE or LOCKTABLE, because the table is not released until the user re- registers. This, in turn, means that a very long blocking is going to restrict the work of other application users. If such a case is unavoidably necessary and has thus occurred deliberately or accidentally, a user session in Web User Setup allows it to be reset so that the processing is aborted.
In the event that a “Yes” or “No” is not sufficient as interaction with a CONFIRM message, you can replace the code:
Selection := Dialog.STRMENU('Yes,No,Cancel',2,'Save?');
with this code:
Selection := ACFManagement.STRMENU('Yes,No,Cancel',2,'Save?');
The functions of codeunit ACF Management are analogous to the same functions in Microsoft Dynamics NAV 2009R2 and are used in order to have the status of long processes (e.g. postings) shown. An example for using dialogs is found in the codeunit ACF Events Admin/Examples, function
OnAction_EXAMPLE(), action code EXAMPLE:PROGRESSW.
Equivalent to the function HYPERLINK from Microsoft Dynamics NAV 2009R2.
Opens a Anveo Page with the contents of the specified URL.
Opens a Anveo Page with the contents of the specified URL which allows a much longerURL than the function OpenURLExtended (find further information here).
Opens a web page showing a Google-maps map at the specified address. For an example see action code CONTACT:OPENGM in the codeunit
ACF Events Sales & Marketing.
Opens a specified Anveo Page in the web client.
Opens a specified Anveo Page in the web client for inserting a new record. Once the Anveo Page is open, the record is created.
Closes the current Anveo Page in the web client.
Creates a new record in the current Anveo Page. This function equals to the action NEW_RECORD() of codeunit ACF Events (see more informationhere).
Reloads the current Anveo Page in the web client.
Reloads all opened Anveo Pages that refer to the table bearing the number indicated. The second parameter of this function sets the scope: 0 = all card, 1 = all lists, 2 = all cards and lists.
Opens a dialog for downloading files or for direct viewing PDF documents, provided that an appropriate browser plug-in is installed.
Opens a dialog for downloading files, regardless of whether it could be displayed directly in the browser plugin or not.
Opens a dialog to upload files. The first parameter of the function returns the file name (without path), where the uploaded file was stored. The file is located after uploading in the transfer directory of the Anveo Client Suite as set up in the Anveo Setup in the field Web Service File Transfer Folder.
Returns the current session ID of the Anveo User.
Returns either the Anveo User code or the global variable USERID of Microsoft Dynamics NAV 2009R2 depending on the C/AL code was called by Anveo Client Suite or by Microsoft Dynamics NAV 2009R2.
Returns the Anveo User code, provided this is invoked within Anveo Client Suite. Otherwise a blank value is returned.
Returns whether the C/AL code is being invoked from the Anveo Client Framework so that different types of behavior can be enacted. Comparable to ISSERVICETIER or GUIALLOWED in Microsoft Dynamics NAV 2009R2.
Returns whether the C/AL code is being invoked from the Anveo Mobile App so that different types of behavior can be enacted. Comparable to ISSERVICETIER or GUIALLOWED in Microsoft Dynamics NAV 2009R2.
Writes a log entry for a given function along with an accompanying text. You can debug your C/AL code using the activated protocolling of all user inputs.
Since xRec is not available everywhere (see here), you can set it using the function SetxRec. Setting xRec already takes place in codeunit ACF Events.
Since xRec is not available everywhere (see here), you can get it using the function GetxRec. Getting xRec already takes place in codeunit ACF Events.
Creates a temporary file on the server where the web service of Microsoft Dynamics NAV 2009R2 is running and returns its name.
When opening Anveo Pages, the source table and relation code are handed over as the parameter instead of the destination table (as is the case in Microsoft Dynamics NAV 2009R2 Standard). Since the destination table is located in the specified relation and all filters (including the security filter) are set there, the Anveo Pages must be opened this way for reasons dealing with security.