Modifying function code output

You can use OLE DB Object Services to make reasonable assumptions when dealing with a Lawson ERP application through a form-based rowset, but this can also be used by the consumer to override these assumptions to gain better control of the consumer application.

You might be required to use the override capabilities when handling output from function codes (FC) displayed on Lawson application forms. Many Lawson ERP applications use a function code to determine what actions are applied to data. With OLE DB Object Services, you can control the output for some of these actions through a set of command properties for form queries.

In the command properties for a form query, you can specify how to indicate end of set and success for Inquire, Next, Add, Change, and Delete function codes (FC).

Note: The function code field is FC in application forms.

To add or change status for any of these options, type the correct codes separated by | (vertical line character) in the spaces provided.

You maintain Lawson error messages through the Message Definition utility (msgmnt). If you are unfamiliar with this utility, see the Doc for Developers: Application Development Workbench (UNIX and Windows) or System Utilities Reference Guide (UNIX, Windows, and IBM i).

This is an example to explain why you might be required to use one of the options on the Function Code Properties dialog box.

Example:

The HR11.1 form returns a status 108 as a warning that the person's salary has gone over a defined limit; however, a change to the person's salary has been successfully applied by a Lawson application. Because OLE DB Object Services adheres to the defined limit unless you specify differently, you must override the status to avoid the warning.

To implement a change, you can specify the Success Statuses on the Change Command to include 108 as a successful status for the application as shown in this form clip.

Form clip: Function code command properties

This is the code that would be generated.

ags:_TKN=HR11.1&FC=I&EMP-COMPANY=122&EMP-EMPLOYEE=1&_CHGSTAT=000|108

When you initialize a rowset with a form query string, you must specify the function code (FC) value for the Inquire or Next class for the rowset to be loaded with information from Lawson. You can empty rowset to insert new records into the Lawson application, you can omit the FC field from the form query string.

To modify function code output

  1. On Query Builder, define the basic form query.
  2. Right-click in the Properties view of the query and select Command Properties.
  3. Expand the Active Command Properties.
  4. Right-click on the function code command property and select Edit Property Value.
  5. Specify a new value and press Enter.
  6. Click OK.