Post Processing using Codeunit No. on Button Page

Summary

Using NAV Anywhere, data processing is done using Connections. Updating/inserting records is one of the specific tasks of the Connection, while the Event generator can be used for posting or registering documents in NAV.

Post processing is commonly done by using the Connection with or without an Event Generator. One specific property of the Event Generator is that it will only run using the Job Queue.

Executing a Codeunit directly from the Button after the Connection has been completed is an alternative for Post Processing.

Purpose

When using a Connection with Event Generator combination, the data processed by the Event Generator is always a background processing event. This means it will be an asynchronous transaction and data is processed with a delay.

Using the Codeunit No. on the Button Page, this will be a synchronous transaction and data is processed immediately. If processed data needs to be shown directly on screen, this is the solution to achieve it.

Releasing a Sales Order

This example will release a Sales Order and immediately needs to show result of the action on screen.

SOopen

The first screen shows a list of Sales Orders and select the “1002” order:

SOreleased
Immediately after the “Release” button is pressed, the list is updated with the Sales Order “1002” being released.

How to setup a Codeunit for Post Processing

Specific settings are required to be able to utilize the Post Processing using the Codeunit No. on a Button.

First, a Codeunit needs to be created, that is solely used for this processing.

SOCodeunit

The Codeunit needs to have the property “TableNo” set to the “NDAW Queue” table. This table has important session information and keeps track of the current “Record ID” that can be used to post, register or release documents.

SOCodeunitProperties

The Button Page does not show the Codeunit No. by default:

SOVisibleColumn

Now the Column “Codeunit No.” is visible and the Codeunit can be added here.

SOButtonCodeunit

About Nico

As the Product Owner, Nico van Wijk is responsible for our Enterprise Mobility and Business Integration Solutions for Microsoft Dynamics NAV. Nico manages all aspects of customer project delivery from initial planning to retaining a customer for life. That challenges him to provide leadership and insight to blended teams of contributors from To-Increase, the customer organizations, and partners. He also participates in setting the direction and driving the development of the mobile and integration solutions. In his years with To-Increase and, earlier, with Dynamics Anywhere, Nico has played a part in the rapid evolution of mobility, supported by increasingly powerful capabilities. Before that, he was a developer for Microsoft Dynamics NAV solutions at Qurius (now Prodware), the large European Dynamics partner. Nico has a B.A. electrical engineering degree from the HZ University of Applied Sciences. When away from work, Nico loves to travel and explore the world.
This entry was posted in Enterprise Mobility, NAV Anywhere. Bookmark the permalink.

Leave a comment