SendDynamic

This method sends a “dynamic” list to a client form or application that requests the current transaction.

To send the dynamic list to the client form or application you, must first populate the list with one or more items by using the Add() method. The SendDynamic method is used with the Glb.ClientManager built-in class of the Client Framework.

Syntax

Glb.ClientManager::SendDynamic(<list> : attribute, [Name : stringExpression]) : void

Parameters

The parameters for SendDynamic method are:

list

An attribute that is an instance of a list

This can be a list attribute (Kind=‘List Attribute’) or an attribute in which the Template property is set to a List type.

Name

The name of the list in a client form or application to be populated

This is an optional parameter. If the name of the list is not mentioned, the list is sent with the name, <OwnerName>.<ListAttributeName>, where ListAttributeName is the name of the list attribute that instantiates the list.

Description

This method sends a “dynamic” list to a client form or application that requested the current transaction. You must first populate the list attribute with one or more items by using the Add() method. It is used with the Glb.ClientManager of the Client Framework.

The list is sent to the client at the end of the current ispec or report transaction, or when a Sleep or CriticalPoint logic statement is executed in a report.

Example

This example shows how to populate a list attribute and then send that list to a client by using the SendDynamic() method.

ProductItem is a class that defines the structure of each list item. Products is an attribute that inherits from a list; it represents the actual list. A ForEach loop reads through the Prod table, and for each record, the loop assigns values to ProductItem and then adds that item to the Products list attribute. Then, the fully populated Products list is sent to the client through the SendDynamic() method:

ForEach Prod in Prod
     ProductItem.Stockbal = Prod.Stockbal
     Products.Add(ProductItem)  : Adds an item to the Products list
End
Glb.ClientManager.SendDynamic(Products) : Sends Products list to the client