SEND

The Send method is used to initiate an ispec message being sent to another AB Suite.

The Send() method initiates an external transaction and is only available for a Class with:

AutomaticEntryCapable = True or

IsExternal = True

To send a transaction with the format of <Instance>,AB Suite developers should issue:

<Instance>.Send()

The Send method transfers data from the originating application to the input buffer of the target Ispec in the external application.

The originating and target Ispecs must have identical specifications.

The GetMessage method is used to retrieve the results of the Send() method.

Note: When executed in a co-routine, Send() sets the built-in segment attribute to NODB and the Glb.Hubstatus built-in segment attribute to INVALID.The transfer is not completed if the Glb.Error built-in segment attribute is equal to a value other than spaces when the Send method is invoked. Changes to value of the Glb.Error built-in segment attribute after the Send method is invoked have no effect on the current Send.

Syntax

<<persistent class>>::Send() : void

Owner

Any persistent class.

Parameters

For a keyed Ispec you can specify the type of operation (“ADD”, “CHG”, “DEL”) by calling the SetMaint() method, passing a string or attribute with the required value as a parameter (refer to example below). By default, the Maint action is ADD.

Example

This example updates or retrieves the SellPrice attribute of the Prod ispec from the DBase1 application.

In DBase1, the Prod Ispec has the following Main method:

If Maint = Glb.Inq                              : For database inquiry 
     SellPrice := Prod.SellPrice
     Recall
End
In the originating application, where Prod is also defined, the following method is specified:
Prod.Initialize()
Prod.External(true)
Glb.Destination := "DBase1"            : Set the destination
Prod.Product := FindProd               : Product is the key for Prod
If In_Maint <> Glb.Inq                     : For database update
      Prod.SellPrice := SellPrice
End 
Prod.SetMaint(In_Maint)
Prod.Send()                      : Send the automatic entry
Prod.GetMessage()                      : Retreive the response back into Prod
If Glb.Status = "NODB"
      Message Attention "DBase1 application not found"
EndExit
If Glb.Status = "*****"
      Message Attention "Rejected by DBase1 update program"
EndExit
If Glb.Status = "DATA"
     SellPrice := Prod.SellPrice
     Recall
EndExit
If Glb.Status = "BUSY"
     Message Attention "DBase1 application busy"
EndExit

The SEND method sets the built-in attributes GLB.STATUS and GLB.HUBSTATUS.