Building an Application Objects API

You can use the API Builder to create a query to Lawson application (form) data, which can be pasted into a VB or other application. When you create an application data query, you are creating an API call to the Lawson Transaction servlet.

Specifying a Transaction call

From any screen of the Lawson Design Studio, select Tools from the main menu (menu that runs along the top left of the screen) and click API Builder.

From the API Builder main page, click Application Objects and then select Productline (Data Area), System Code, and Form.

Form clip: API Builder showing Transaction selection options

On the next form that appears, make selections for these items:

  • Form Properties: These are the form fields. You can select to have the fields display in alphabetical order instead of form order. If you de-select the Hidden button, only fields that are visible to the user are available to your query. If your query is looking only for data that a user might have updated, you can de-select hidden fields to minimize the number of fields your query must access. This can be a performance advantage when your query processes.

  • Methods: The actions that can be applied to this form, including Add, Change, Delete and so on).

  • Selected Elements (if any): Type key fields as required for any selected fields.

Click Build Query when you are finished making selections.

The Build API option creates the data query string and displays it in the bottom of the browser window. Click the Test Query button to test the API. The XML code generated by the call displays in a new browser window. If the code is what you expected, you can copy and paste it into another application, such as a VB application or Crystal report.

After creating the string, you can test it to determine if the string returns the information you expect. To test the string, click the API at the bottom of the form. A new browser window appears with your string displayed in the URL line and the results display in the browser window.

API Builder Test API results

When the API returns the values you expect, you can copy and paste the string into the source code for a form. When the form runs, it automatically retrieves the data you specified.