The Store built-in persistent class method updates the class's persistent attributes in the database.
The Store method is used to initiate automatic entries and Store() is only valid for internal automatic entries.
Internal automatic entries
For internal automatic entries, the Store method transfers data to the database table of the target ispec. It can be invoked more than once to transfer a record each time it is called.
If the target ispec is an event, the ISPEC, TRANNO, Input_Date, and ACTMTH built-in attributes are handled automatically.
The Store method currently stores the current object in memory as a record in the local database. On completion of a successful Store(), the newly created database record is current in memory.
The Store() method will not be available for a Class with:
IsExternal = True.
To initiate a local database update to the <Ispec) table, AB Suite developers should issue:
<Object>.Store()
External transaction entries are handled with the Send() and GetMessage() methods. Please refer to Send() and GetMessage() methods for further details.
Syntax
<<persistent class>>::Store() : void
Owner
Any local persistent class.
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 adds a Cust ispec record to the database:
Cust.Initialize() Cust.Customer := Customer Cust.ASpec := SDBank Cust.Amount := Amount Cust.Amount.Contra() Cust.SetMaint(MAINT) Cust.Store() : Adds an ispec record Cust.Initialize()
The Store method sets the GLB.STATUS built-in segment attribute.
The Glb.Status built-in segment attribute is set to "*****" in the following situations:
If the Store attempts to add a record with an existing key value to an ispec, or to update or delete a nonexistent record.
If the MAINT attribute is set (via SetMaint() method) to a value other than "ADD", "CHG", "DEL", or "PUR" (if the Ispec's Allow Purge property is set to true).