View Article

Configure the Consume Get Web API on a Maintenance Form with the Default Method

By Xelence Documentation posted 10-07-2021 11:01

  

Introduction

One way to display data from the specified resource on a maintenance form is the form entity's default method (Load). Whenever a user opens the form, the form automatically displays the API data.

You can configure the form entity on the form or on the API file. This example configures the entity on the form.

Prerequisites

  • The Consume Web API file you need must already exist.
  • The Maintenance form you need must already exist.
  • The Lookup form you need must already exist.
Quick Steps
1 Open the Maintenance form
2 Open the Configuration tab, then open the API section
3 Add an API entry, enter the API details, then save the API configuration
4 Open the Entity section
5 Add an API entry in the Update section, enter the API details, then save the Entity configuration
6 If necessary, add a container to the form
7 Add the API collection to the form
8 Select the columns, then click Finish
9 Save the form
10 Open the Lookup form
11 Configure the Open button
12 Save the form

Detailed Steps

Step 1. Open the Maintenance form.

Open the maintenance form you want to display API data on. In this case, that's wfmUserMaintenance.



Step 2. Open the Configuration tab, then open the API section.

Click the Edit icon to open the API section. This is where you will add the API details so your form can use the file.



Step 3. Add an API entry, enter the API details, then save the API configuration.

Click the Add API details icon to add the entry.


Important properties are:

  • ID: Name of the API to be used in the form.
  • API: API file name.

You must click the Save icon in the API section so the form can use the API configuration.

Click Yes to save the details.



Step 4. Open the Entity section.

Click the Edit icon to open the Entity section. This is where you will add the API, which will load the data in the form in new/update mode. This example loads the data in update mode only.



Step 5. Add an API entry in the Update section, enter the API details, then save the Entity configuration.

Click the Add API details icon in the Update section.

Important properties are:

  • API: Name of the Consume API file you are loading the data from.
  • Parameter: Automatically displays the parameter from the Consume API file.

You must click the Save icon in the Entity section so the form can use the Entity configuration.

You can also use an Execute API button which will call the configured API and load the data in the form. Consume Post Web API can also be executed using the Default Form Load method.


Click Yes to save the details.



Step 6. If necessary, add a container to the form.

Your form will display the API data with a collection control, which will need a container. If your form doesn't already have a container you want to use, add one.

Drag the container control (in this case, a Collapsible control) to the form and enter the caption and layout. Since you're going to put a collection in the control, it's best to reduce it to one row with one column.

You can update the caption and number of rows and columns. Click OK.



Step 7. Add the API collection to the form.

Xelence adds the Collapsible control. Open the API section and drag the desired collection to the desired container. In this case, that's lstResponse.

Open the API section and drag the desired collection to the desired container. In this case, that's lstResponse.



Step 8. Select the columns, then click Finish.

These are the columns whose values you want in the data table. Select the columns and click the add button to add the columns.


Xelence adds the data table.



Step 9. Save the form.

Click the Save icon to save the form.



Step 10. Open the Lookup form.

Open the lookup form that is linked to the maintenance form. In this case, that's wfmUserLookup.



Step 11. Configure the Open button.

To pass the parameter, you must configure the control that opens the maintenance form. In this case, that's the lookup form's Open button. Select the Open button and open the properties section.


Update the properties:

  • Active Form: Form that the button navigates to when clicked. In this case, it is wfmUserMaintenance.
  • Navigation Parameter: Determines how the application passes the parameter.
    Navigation Parameter options are:

    Parameter Value: Allows you to enter the specific value of the parameter. This example uses "USA".
    Is Constant: If checked, the Parameter Value is constant.

      Enter the parameter value and make it constant, then click OK.


      Step 12. Save the form.


      Then, run the Preview. Xelence displays the form output. You can test your updated settings.

      When you have previewed your form, it should look something like this. When you open an existing record, the screen displays the API data.

      You cannot open the maintenance form directly from the preview. You must open the lookup form and open the maintenance form so the application can pass the API parameter.



      What are the improvements over S3 Version 6?

      This is a new process.


      Related Articles

      Create an Access Token and Consume Get Web API File

      Configure the Consume Get Web API File

      Configure the Consume Get Web API on Maintenance Form with the Execute Button

      Configure the Consume Post Web API on a Maintenance Form with the Default Method


      This post is part of the Web API topic. Click here to open Web API Overview


      #Develop
      #Development Studio
      #Task Steps
      #Everyone
      #Text Help

      #Xelence
      #API

      #WebAPI

      #ControlsandButtons

      0 comments
      151 views