Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : ABL API for Multi-tenant and Table Partition Management : Maintaining multi-tenant and table partition entities : Areas (creating and reading)
 
Areas (creating and reading)
The following code shows how to use the API service to create and read an area using the IArea interface. The area cannot be deleted from the database after it has been created and consequently the service has no delete method:
define variable area as IArea no-undo.

area = service:NewArea("MyArea").
/* Set properties and add extents */
. . .
service:CreateArea(area).
The properties cannot be edited after creation, but the update method is used to add extents to the area:
area = service:GetArea("MyArea").
/* Add extents */
. . .
service:UpdateArea(area).
It is also possible to retrieve a collection of areas in the database from the service and create areas and/or add extent to the areas in the IAreaSet collection before passing the collection to the service:
define variable areas as IAreaSet no-undo.
define variable area as IArea no-undo.

areas = service:Areas().

area = service:NewArea("OrderArea").
/* Set properties and add extents */
. . .
areas:Add(area).

area = areas:Find("InventoryArea").
/* Add extents */
. . .

service:UpdateArea(areas).
For more information on the:
*IArea entity interface, see IArea interface
*IAreaSet entity collection interface, see IAreaSet interface