Save method: RowsetCache class

Syntax

Save([[Rowset.]name] [, Description] [, Lang])

Description

Use the Save method to save a new or existing rowset to the cache. If a rowset of the specified name already exists, it will be replaced. Otherwise, the rowset will be added.

If this method is called as part of a larger transaction, such as in the SavePreChange or SavePostChange event, The commit is tied to the commit of the outer transaction. If an error occurs in this method, the outer transaction will be rolled back.

If this method is invoked in a non-transactional PeopleCode event (such as RowInit) the commit is controlled by the regular Component Processor flow.

Parameters

Parameter Description

Rowset. name

Specify the name of the rowset to be saved to the cache. If you just specify name, you must enclose the name in quotation marks.

Description

Specify a text string describing the rowset.

Lang

Specify the language to use when saving the rowset. See the values below.

The values for the Lang parameter are:

Value Description

%RowsetCache_SignonLang

Attempt to save the rowset to the cache using the sign-in language. However, if the base language rowset doesn't already exist in the cache, then the save to the sign-in language fails. This is because the system requires that base language data exist before related language data can be saved.

If the Lang parameter is omitted, this is the default behavior.

%RowsetCache_BaseLang

Save the rowset to the cache using the base language.

%RowsetCache_SignonOrBaseLang

Attempt to save the rowset to the cache using the sign-in language. If that fails, then save the rowset using the base language.

Returns

A Boolean value: True if the save was successful, False otherwise.

Example

The following code cashes &RS as a rowset definition.

Local RowsetCache &CRS;
Local Rowset &RS;

&CRS = GetRowsetCache(Rowset.MyRowset);

If (&CRS <> Null) Then 
   &RS = &CRS.Get();
. . . /* do processing */
Else
   /* do error processing */
End-if;

&CRS.Save();