Skip to main content
Get confirmed orders from AGR into NAV

Transfer orders from AGR to NAV with these steps.

Updated over a week ago

Important!
This information is for users of Microsoft Dynamics Navision (NAV)

Overview

To send orders that are created, reviewed, adjusted and confirmed in AGR to NAV, an extension needs to be installed in your NAV environment. This article guides you through the installation process.

Installation Guide

1. Import objects

To install the order transfer module, you will need either AGRObjects.fob or AGRObjects.txt, downloadable from the link below.

Warning

Object IDs in AGRObjects.txt will overwrite the existing objects in NAV in case of a conflict. Compare the AGR object IDs before importing to ensure no data is lost.

You can use either of the files above to import the module objects listed in the table below into NAV.

Type

ID

Name

Version List

Table

50040

AGR Setup

AGR1.0

Table

50042

AGR Import Item

AGR1.0

Table

50043

AGR Log

AGR1.0

Codeunit

50040

AGR Synchr.Start

AGR1.0

Codeunit

50041

AGR Synchr.TestImport

AGR1.0

Codeunit

50042

AGR Synchr.Import

AGR1.0

Codeunit

50043

AGR Carry Out Req Message

AGR1.0

Page

50040

AGR Setup

AGR1.0

Page

50042

AGR Import Lines

AGR1.0

Page

50043

AGR Log

AGR1.0

Page

50044

AGR Import Log

AGR1.0

Menusuite Placement

The interface should be set up within the Purchase Department in any of the Add-on X Menusuites. Adding the AGR Setup Page is sufficient, but we recommend adding the AGR Log and AGR Import Log as well.

2. AGR - NAV interface setup

You will need to populate the AGR Setup page with the correct data to connect to AGR's SQL database with the orders. Each record comes with some default values, as shown in the table below, that can be changed as needed.

Field name

Description

Default value

SQL Server

Server Name of where the AGR SQL Database is located. Used to connect to AGR. Provided by AGR.

N/A

SQL Database

Database Name of the AGR SQL Database. Used to connect to AGR.

N/A

SQL User Id

ID of a user that can connect to the AGR SQL Server and Database. Used to connect to AGR. Provided by AGR.

N/A

SQL Password

Password for User defined in field SQL User ID. Used to connect to AGR. Provided by AGR.

N/A

SQL Connection Timeout

Defines when connection to SQL Server will timeout. Used to connect to AGR. Provided by AGR.

N/A

Req. Worksh. Template Name

Defines the Requisition Worksheet Journal used when importing lines from AGR

N/A

Req. Worksh. Jrnl. Batch Name

Defines the Requisition Worksheet Batch used when importing lines from AGR

N/A

Enable Log Cleanup

Enables Log Cleanup which will delete entries based on value in field Keep History for

Yes

Keep History For

If Log Cleanup is enables, this fields defines what values are deleted from the AGR Log

1 Week

Last Cleanup

Defines when the Log Cleanup was last done. Not editable

Today

See below for and example of the AGR setup.

3. Manual order pull test

Orders can be pulled into either NAV automatically or manually. When first setting up the interface, we recommend testing manual pulls before setting up automatic jobs to retrieve orders at a set frequency.

Manual pulls can be done from the AGR Setup page by pressing Retrieve AGR Lines in the HOME tab. This will connect to the AGR database and pull orders that have been reviewed and confirmed in AGR and are ready to be imported into NAV.

The order import process goes through three steps.

  1. Orders are imported from AGR into the AGR Import Lines page in NAV.

  2. AGR Import Lines are imported into a Requisition Worksheet.

  3. The Requisition Worksheet is processed and Purchase Orders are created.

If the orders can‘t be pulled into NAV for some reason, the AGR Import Items page will open with all lines that were retrieved from the database, regardless of whether they have errors in them.

Warning

AGR Import Lines only holds information from the last connection. All lines with errors will continue to be imported to NAV if they are not corrected.

If the interface is able to process lines fully, then the lines will only remain in AGR Import Lines until the next connection is made with the AGR Server.

The AGR Import Lines page has the following fields.

Field

Description

ID

Row number in import

orderItemNo

Item No. from AGR

orderToLocation

To-Location from AGR

orderFromLocation

From-Location from AGR

orderQty

Quantity from AGR

orderEstDelivDate

Estimated Delivery Date from AGR

orderType

Type of order from AGR

orderId

AGR Order ID

Worksheet Template Name

Worksheet Template Name from AGR Setup in NAV

Journal Batch Name

Journal Batch Name from AGR Setup in NAV

Error Message

If marked, this field indicates that the line was not processed due to an error.

Messages

This field is only filled in if the line was not imported due to an error. The error message can either originate from within the AGR interface in NAV or is a standard error message from NAV.

Error Type

This field is only filled in if the line was not imported due to an error. The value indicates when the error happened.

  • OnImport to Wrksht: The interface was unable to process the line from the AGR Import Lines into the Requisition Worksheet.

  • OnPost of Wrksht: The interface was unable to process the line from the Requisition Worksheet.

  • Order on Error: A line within the order has an error. All processing was stopped for that order.

Common issues that cause errors in the transfer of orders include:

  • The AGR Order Supplier, [Vendor Name] does not exist as a Vendor or a Location.

    • Check the vendor card to see that the vendor can be found in NAV

    • Check that the vendor card is open in NAV

    • Check that the vendor card in NAV is not marked as blocked or blocked for purchasing.

  • The Req. Worksheet is empty.

  • Connection to SQL was not successful.

    • Make sure that there are values in the AGR Setup page, as described earlier on this article.

Each time that NAV connects to AGR for an order transfer, it creates a log entry of the communication. After the import has finished, the entry shows how many errors occurred during the import.

4. Job queue setup

When the AGR Setup and manual testing are finished, a job queue can be created to fetch AGR orders automatically. Assuming a Job Queue and Job Queue Category have been created, a Job Queue entry can be created as shown in the image below. The Job Queue Entry should run Codeunit AGR Synchr. Start (ID 50040). We recommend setting the time interval to 5 minutes between runs. This can be changed depending on other Job Queue Entries that are running in the system.

Codeunit 333 Req. Wksh. -Make Order needs to be changed for the job queue function to work. Every variable of type window needs to be handled, only triggering it if AGR fetching of orders happens from a NAV client. To handle this use the command IF GUIALLOWED THEN. See images of the required changes below.

The screenshot below shows changes needed for NAV 2016 only

Did this answer your question?