Skip to main content
Get confirmed orders from AGR to BC 13-16
Updated over a week ago

Important

This article is for users with Microsoft Business Central (BC), versions 16 or older. If you have a more recent version of BC, please refer to our article on installing the AGR Data Integrator

Overview

To get orders that are created, reviewed, adjusted and confirmed in AGR sent into BC, an extension needs to be installed in your BC environment. This article is intended to serve as a guide through the installation process.

Installation Guide

1. Import objects

To install the order transfer extension, click on the .app file linked below and upload it into your BC environment.

A list of the imported objects can be seen in the table below.

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 - BC 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. Provided by 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

Number of seconds before the SQL Server connection will timeout. Used to connect to AGR

610

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.

When the AGR Setup is finished, you can use Test AGR Connection on the ACTIONS tab to verify that the connection information is correct.

3. Manual order pull test

Orders can be pulled into BC either 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 BC.

The order import process goes through three steps:

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

  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 BC for some reason, the AGR Import Items page will open with all lines that were retrieved from the database, regardless of whehter they have errors in them.

Warning

The AGR Import Lines only holds information from the LAST connection. All lines with errors will continue to be imported into BC if they are not dealt with. 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

Rownumber 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 BC

Journal Batch Name

Journal Batch Name from AGR Setup in BC

Error Message

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

Messages

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

Error Type

This field is only filled out 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 is on error and therefore all processing was stopped for that order.

Common issues, causing errors in the order transfer 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 BC.

    • Check that the vendor card is open.

    • Check that the vendor card 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 in this article.

If the AGR Import Lines does not open after processing, there were either no errors on the import or there was nothing to import.

Every time that BC connects to AGR to import orders, it creates a log entry to keep track of the communication. After the import has finished the entry shows how many errors happened 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 Categoryexit, a Job Queue entry can be created similar to the image below. The Job Queue Entry should run Codeunit AGR Synchr. Start (ID 50040). The recommended setting is to set the time interval to 5 minutes. This can be changed dependung on other Job Queue Entries running in the system.

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

Attachment icon
Attachment icon
Did this answer your question?