CubeDataReservationGet
This is a TurboIntegrator function, valid only in TurboIntegrator processes.
Syntax
CubeDataReservationGet(Index, Cube, User, [AddressDelimiter]) returns Address;
Argument |
Description |
---|---|
Index |
A one-based loop index to use for iterating through reservations on the specified cube. |
Cube |
Name of the cube to search. |
User |
Reservation owner name to use as a filter. If left blank, the function returns reservations for any owner. If a name is provided, the function filters the results for just the specified owner. |
AddressDelimiter |
Optional character string that is used to separate element names in the returned Address parameter. Default value is '|'. |
Return Value
Address - Reservation creation time, name of the reservation owner and Element address of the reservation. Creation time comes first, followed by delimiter, followed by UserID, followed by delimiter, followed by Elements IDs separated by the delimiter in order of dimensions in the cube (original order).
An empty string is returned if there is no entry for the specified index.
The format of the return value is:
[creation time][delimiter][owner name][delimiter][element1][delimiter][element2][delimiter]…[elementN]
For example:
"20100622211601|Fred Bloggs|Element1|Element2|Element3"
If the owner filter is specified, then the index applies only to the members of the filtered list. If the list of reservations has owners as follows: User1, User1, User2 and the request specifies an owner of User2 then an index of 1 will retrieve the third member of the list.
Example
CubeDataReservationGet(1,'DRTestCube','User1','*');
CubeDataReservationGet(1,'DRTestCube','');
The following sample would find all the reservations owned by user Fred Bloggs in the Expense Input cube and do "something useful" with them:
vIndex = 1;
vCube = 'Expense Input';
vUserFilter = 'Fred Bloggs';
vDelim = '|';
vAddress = CubeDataReservationGet( vIndex, vCube, vUserFilter,vDelim);
WHILE (vAddress @<> '');
vSep1 = SCAN( vDelim, vAddress);
vDRUser = SUBST( vAddress, 1, vSep1 - 1);
vDRAddress = SUBST( vAddress, vSep1 + 1, LONG(vDRAddress) - vSep1);
# do something meaningful with the
user and reservation address here
vIndex = vIndex + 1;
vAddress = CubeDataReservationGet( vIndex, vCube, vUserFilter,vDelim);
END;