AMT Help Files

Call Application Link

Syntax Color Legend
Command
Mandatory parameter
Optional parameter
Mandatory keyword
Optional keyword

Syntax

CALL (<Destination> , <Form> , <Buffer>, <Status>, <Time-out>)

Description

Sends a transaction to a form in an external application that is linked to the form or report in which the CALL statement resides by a defined Application Link.

Diagram

Returned value type

None

Parameters

Parameter Description
<Destination> Expression that specifies the name or alias of an external LION application.
<Form> Expression that specifies the name of a form in the external application.
<Buffer> Name of a defined Application Link buffer.
<Status> Contains the status of the CALL action. This value is also stored temporarily in the system item GETLASTRESULT.
<Timeout> Maximum time to wait for a connection to the destination, measured in seconds.

Instead of the application name, an Alias can also be used.

Remarks

By default, an Application Link continues to use the already established database connection. Therefore, a commit inside the logic of an Application Link call also affects the calling object. By using aliases, you can use an Application Link with a new database connection by enabling the New Connection setting in the Control Center (see Aliases). In that case, the alias name must be used instead of the application name in the CALL.

The Application Link buffer is used to send and receive data to and from the form of the external application. In the buffer, all the controls of the form are accessible in the form <buffer>.<control>, as shown in the example below.

When multiple copies of the same application are used as the destination for Application Link calls, such as when using the Application Installer, you can use only a single Application Link in the calling application unless you use the remote call option through an Alias.
This is because copied applications have form libraries with the same identifiers (.NET fully qualified type names). When the remote call option is not used, it becomes unpredictable from which copied application the form libraries are used. In this case, the remote call option should be used.

Example

routine applink_destcustomerreq

var
  applinkstatus : string
  listno        : numeric 2
  item          : alpha 100

begin_routine
  with customer_management_customer
    .cust_no := 1
    loop for listno := 1 to 10
      .button_action := 'I'
      call ('customer_managment', 'customer', customer_management_customer, applinkstatus, 180)
      if applinkstatus = ''
        if .cust_no <> 0
          item := '|' + .cust_no + '|' + .firstname + ' ' + .lastname + ' ' + .city + ' ' + .tel_no
          fillbox ('APPLINK_DEMO.Customer', item)
        else
          break
        endif
      else
        smex ('Application Link not successful: ', applinkstatus)
        break
      endif
    endloop
  endwith
end_routine

Contents