# Infor Lawson S3 AGS Transaction Call Generator

> Source: https://netray.co/tools/infor-lawson-s3-ags-transaction-call-generator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Fill in the product line, form token, event, function code and form fields to get a Lawson Transaction (AGS) call URL you can test in a non-production product line.

## Category

developer

## Erp

Infor Lawson S3

## Audience

- Lawson developer
- Integration developer
- Process Flow developer

## Tool

**Kind:** template

**Output:** code

**Language:** http

**Fields:**

#### Server base URL

**Key:** base

**Type:** text

**Default:** https://lawson.example.com

#### Product line (_PDL)

**Key:** pdl

**Type:** text

**Default:** TEST

**Help:** Use a test product line first

#### Form token (_TKN)

**Key:** tkn

**Type:** text

**Default:** PA52.1

#### Event (_EVT)

**Key:** evt

**Type:** select

**Options:**

- ADD
- CHG

**Default:** ADD

#### Function code (FC)

**Key:** fc

**Type:** select

**Options:**

- A
- C
- D
- I

**Default:** A

**Help:** Function code letters as shown on the form

#### Return (_RTN)

**Key:** rtn

**Type:** select

**Options:**

- DATA
- MSG
- SENT

**Default:** DATA

#### Long field names (_LFN)

**Key:** lfn

**Type:** select

**Options:**

- ALL
- TRUE

**Default:** ALL

#### _TDS

**Key:** tds

**Type:** text

**Default:** IGNORE

#### Field 1 name

**Key:** f1n

**Type:** text

**Default:** PCT-COMPANY

#### Field 1 value

**Key:** f1v

**Type:** text

**Default:** 100

#### Field 2 name

**Key:** f2n

**Type:** text

**Default:** PCT-EMPLOYEE

#### Field 2 value

**Key:** f2v

**Type:** text

**Default:** 1001

#### Field 3 name

**Key:** f3n

**Type:** text

**Default:** PCT-ACTION-CODE

#### Field 3 value

**Key:** f3v

**Type:** text

**Default:** ADJUSTMENT

#### Field 4 name

**Key:** f4n

**Type:** text

**Default:** PCT-EFFECT-DATE

#### Field 4 value

**Key:** f4v

**Type:** text

**Default:** 20261101

**Help:** ccyymmdd unless you send _DATEFMT

#### Field 5 name

**Key:** f5n

**Type:** text

**Default:** PCT-REASON1

#### Field 5 value

**Key:** f5v

**Type:** text

**Default:** ADJ-DSPINC

#### Field 6 name

**Key:** f6n

**Type:** text

**Default:** PCT-UPDATE-BENEFIT

#### Field 6 value

**Key:** f6v

**Type:** text

**Default:** Y

#### User for curl test

**Key:** user

**Type:** text

**Default:** lawsonuser

**Blocks:**

#### 1. LSF 9 / 10 Transaction service (GET)

**Body:** GET {{base}}/servlet/Router/Transaction/Erp?_PDL={{pdl}}&_TKN={{tkn}}&_EVT={{evt}}&_RTN={{rtn}}&_LFN={{lfn}}&_TDS={{tds}}&_OUT=XML&FC={{fc}}&{{f1n}}={{f1v}}&{{f2n}}={{f2v}}&{{f3n}}={{f3v}}&{{f4n}}={{f4v}}&{{f5n}}={{f5v}}&{{f6n}}={{f6v}}

#### 2. curl test against a test product line

**Body:** # Prompts for the password. Behind SSO this may return a logon HTML page instead of XML.
curl -s -u "{{user}}" "{{base}}/servlet/Router/Transaction/Erp?_PDL={{pdl}}&_TKN={{tkn}}&_EVT={{evt}}&_RTN={{rtn}}&_LFN={{lfn}}&_TDS={{tds}}&_OUT=XML&FC={{fc}}&{{f1n}}={{f1v}}&{{f2n}}={{f2v}}&{{f3n}}={{f3v}}&{{f4n}}={{f4v}}&{{f5n}}={{f5v}}&{{f6n}}={{f6v}}"

#### 3. POST variant

**Body:** # The LSF Transaction service also accepts POST with an XML document instead of a query string.
# Build the XML with the query builder tool for your release rather than writing the schema by hand,
# then POST it to the same endpoint:
POST {{base}}/servlet/Router/Transaction/Erp
Content-Type: text/xml

#### 4. Legacy Environment 8 AGS program

**Body:** # Older Lawson Environment servers ran AGS as a CGI program (ags.exe on Windows).
# Note: LSF indexes detail rows from 0 (_f1r0); earlier AGS versions started at row 1.
GET {{base}}/cgi-lawson/ags.exe?_PDL={{pdl}}&_TKN={{tkn}}&_EVT={{evt}}&_RTN={{rtn}}&_LFN={{lfn}}&_TDS={{tds}}&_OUT=XML&FC={{fc}}&{{f1n}}={{f1v}}&{{f2n}}={{f2v}}&{{f3n}}={{f3v}}&{{f4n}}={{f4v}}&{{f5n}}={{f5v}}&{{f6n}}={{f6v}}

#### 5. Reading the response

**Body:** # Check these in the returned XML:
#   MsgNbr 000  = no error
#   MsgNbr ***  = transaction code error
#   MsgNbr nnn  = application message from the form (look up the text in Message)
#   FldNbr      = the field the message relates to, if any
#   _PRE        = returned when a pre-emptive inquire happened (for example with _EVT=CHG)
# Only treat the call as successful when the message matches the form's normal completion message.

**Notes:** Endpoint, GET and POST support and the _PDL, _TKN, _EVT, _RTN and _LFN meanings follow the LSF 10.0 Transaction service documentation. In 9.0.x and later, _OUT supports XML only. _TDS=IGNORE and the FC parameter appear in working LawsonGuru examples (FC=A, and in Process Flow output FC=Add), but the LSF page does not document them, so test on your release. Default field names are from a PA52.1 example. Action and reason codes are site-defined. Use the form's field help for other tokens, and never invent field names. Run in a test product line first: an incorrect _EVT=ADD can corrupt data.

## Content

**Intro:** This generator builds Lawson S3 Transaction service calls, called AGS in older releases, for LSF 9 and 10 and for legacy Environment 8 servers. A Transaction call runs a Lawson form, such as PA52.1, with the same edits and security as a user at the screen. That makes it the safe way to write data from scripts and integrations.

**Sections:**

#### How to use it

**Body:** Set the server URL and a test product line. Enter the form token, for example PA52.1 for Individual Action. Choose the event, the function code and what the service should return. Then enter up to six form field names and values. Field names are form field names, the long names shown in the form's field help, not database columns. The defaults come from a PA52.1 example that adds a personnel action. Copy block 1 into a signed-in browser, or use the curl block, against the test product line. Check the message number in the response, then check the record on the form before you move the call to production.

#### What the parameters mean

**Body:** The LSF 10.0 Transaction service documentation defines the core parameters. _PDL is the product line, and if it is omitted the user's default product line is used. _TKN is the form token, and if you send only the program code, the service tries the .0 screen and then .1. _EVT=ADD skips the pre-inquire, while CHG forces one so blank fields are filled first. _RTN=DATA returns full transaction data, MSG returns messages only and SENT echoes the sent tags. _LFN=ALL returns long names for all fields. Fields can be sent by long name or by _f number from the transaction map.

**Bullets:**

- _PDL: product line (data area)
- _TKN: form token, for example PA52.1
- _EVT: ADD or CHG
- _RTN: DATA, MSG or SENT
- _LFN: ALL or TRUE
- FC: function code letter from the form (A add, C change, D delete, I inquire)

#### Worked example

**Body:** HR wants to load a batch of pay adjustments through PA52.1 instead of keying them. Set _TKN=PA52.1, _EVT=ADD and FC=A. Send PCT-COMPANY, PCT-EMPLOYEE, PCT-ACTION-CODE, PCT-EFFECT-DATE in ccyymmdd form and PCT-REASON1 with your site's codes. Run one call against the test product line with _RTN=DATA. If MsgNbr is 000 and the message matches what PA52.1 shows on a manual add, open the action on the form and check every field. Then loop over the batch, logging each response, and stop on the first non-zero message.

#### Gotchas

**Body:** Single sign-on often intercepts direct calls and returns a logon page instead of XML. Test from a signed-in browser before scripting. _EVT=ADD in the wrong situation can corrupt data, so use CHG when you are changing an existing record. Detail lines are numbered from row 0 in LSF (_f1r0), not row 1 as in older AGS. In 9.0.x and later, only XML output is supported, and several older parameters such as _DELIM and _XSL are listed as unsupported. Transaction calls run with the caller's security, so a service account needs the right form access and nothing more.

**Cta:** If you want routine Lawson updates prepared by an AI assistant on your own servers, with a person approving each Transaction call before it runs, we can build that.

**Faq:**

#### What is a Lawson AGS call?

**Answer:** AGS, the Application Gateway Service, was the older name for the Lawson service that runs a form transaction over HTTP. In LSF it became the Transaction service at /servlet/Router/Transaction/Erp. A call names the product line, form token, function code and field values, and returns the form's messages and data as XML.

#### Can I use AGS calls from Infor Smart Office or the Lawson add-ins?

**Answer:** Smart Office, Design Studio and the Lawson add-ins for Excel run Lawson forms with the same form edits, security and messages that apply to a Transaction call. This generator gives you the raw URL so you can test or script a call outside those tools.

#### What does _EVT=CHG do?

**Answer:** _EVT=CHG forces a pre-emptive inquire before the function code runs. The service fills in blank fields from the existing record, so you only send the fields you are changing. _EVT=ADD skips the inquire. If _EVT is omitted, the service decides based on the function code.

#### How do I find the field names for a Lawson form?

**Answer:** Open the form and use field help, or check the form's transaction map in Design Studio. That gives you the long field names, such as PCT-EMPLOYEE on PA52.1, or the _f numbers. Do not use database column names. They differ from form field names and the call will fail.

## Search terms

infor lawson add in, infor smart office lawson, infor lawson screens, infor lawson software, lawson ags call, lawson transaction service, servlet router transaction erp

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
