ANVEDI Job Handler
Microsoft Dynamics NAV 2013R2 has a job scheduling system that allows you to run codeunits at certain times. Anveo EDI Connect offers a dedicated codeunit that can be used. The codeunit has the ID 5327312 and is called ANVEDI Job Handler.
This codeunit offers different jobs and can be controlled by the parameter string. This string follows simple rules and we will show you examples for each of the available actions. The general syntax of this parameter is:
There are two parameters that are available for most jobs, except for Business Transactions:
Controls whether post-processings are executed automatically. This defaults to False, if not specified.
The post-processing should run afterwards
The default setup will determine if post-processings will run.
This parameter is optional. The default value is no table view. This parameter specifies a view on the table for the EDI Processing Queue that is used if ProcessFollowing=True. The string has to be a Microsoft Dynamics NAV 2013R2 table view, like WHERE(Project Code=FILTER(A*)).
Frequently Used Actions
Most of the times, you will want to use one of the following actions:
Maintenance
Anveo EDI Conect has built-in retry functionality for temporary problems, such as an unreachable server. You can set the retry interval, etc. in mappings and communication channels, but you’ll need to create a job to handle them. To configure such a job, select our job handler codeunit in the job queue (ANVEDI Job Handler, ID 5327312) and set the parameter string to MAINTENANCE(). There are not configuration options at the moment.
Schedule the job to run regularly without interfering with other EDI processes. Depending on your version of Dynamics, you can use the jopb queue category to run only one job in a category at a time. If there is nothing to do, the job will finish almost immediately.
Receiving data
This action will receive data for a specified communication channel or folder.
You will have to specify one of the following parameters:
Specifies a filter string to the communication channel code. This can either be the full code, or a filter string.
Specifies a filter string to the transmission folder code. This can either be the full code, or a filter string.
Run a mapping
Often times, if you want to export data you either start with a business transaction job, or a NAV mapping. But the scheduling system can run any kind of mapping.
The allowed parameters are:
The project code or a filter string on the project code.
The format code or a filter string on the format code.
The mapping code or a filter string on the mapping code.
Safety feature. Whether multiple mappings should be executed. Defaults to False.
Multiple mappings can be executed.
Multiple mappings cannot be executed.
Collect Business Transaction Data
If you have a business transaction type with data collection, you can use the following parameter string:
There is only one parameter:
The code of the business transaction type. This parameter does not allow filters.
Maintenance
If you want to use the automatic retry functionality of the mappings or communication channels you have to setup a simple maintenance job. This job is really fast is there is nothing to do and can run quite frequently. Please consider that the job has to run at least as often as you want to retry actions.
The job has no parameters.
Advanced Actions
The following actions are more specialized and are not used that frequently.
Batch Process Business Transaction Data
The code of the Batch. This parameter does not allow filters.
Collect and Batch Process Business Transaction Data
This is a combination of BT_COLLECT and BT_BATCH.
The code of the Batch. This parameter does not allow filters.
The code of the business transaction type. This parameter does not allow filters.
Process Open Processing Queues
If you do not run post-processings automatically you can setup jobs to run certain open actions.
You can use the parameters ProcessQueueView and ProcessFollowing.
Send Open Transmissions
Usually sending data is done as a post-step of the mapping execution. If you want however to send open files at a certain time, you can use a job.
Specifies a filter string to the communication channel code. This can either be the full code, or a filter string.
Specifies a filter string to the transmission folder code. This can either be the full code, or a filter string.
Run Custom Code Callback
You can use the job handler codeunit to run your custom code.
You can specify as many parameters as you need. We recommend using a parameter Name to specify a callback identifier. You can access the parameters from the ANVEDI Callback codeunit. In codeunit ANVEDI Callback in the function CallbackRegistration you can react to the OnJobCallback event by implementing the following CASE block:
Please note that the parameter names are converted to uppercase in the variable ParameterDictionary. You can use the following parameter string in the Job Queue to call the callback: