Using Procedure Functions
Using Procedure Functions
This section contains the Longview Application Framework functions you can use in a procedure. Click the links in the following table for detailed usage and syntax information.
For information on using Longview Application Framework functions in a model, see Using Model functions.
Abs
GetSymbolCreatedTimeStamp
IsMaintenanceUser
SetDataTableCell
AttributeExis...
Abs
Abs
Use this function in an equation to evaluate an expression and to calculate its absolute value. Absolute value is the expression of a number as a positive value, regardless of whether it is actually positive or negative.
You may find the Abs function useful for learning the deviation between planned and actual results.
CopySyntax
ABS (Expression|Value)
where:
Each Expression ...
AttributeExists
AttributeExists
Use this function to determine whether the specified attribute exists in the database. A return value of 1 means the attribute exists in the system; a value of 0 means that it does not.
CopySyntax
ATTRIBUTEEXISTS ("AttrClass", "AttrName")
where:
AttrClass is the attribute class that contains the attribute to search for.
AttrName is the name of the attribute.
Co...
Avg
Avg
Use this function in an equation to calculate the average value of a set of numbers.
For information on using this function in a model, see Avg.
CopySyntax
AVG (Value|Expression[,Value|Expression])
where:
Value is a quoted string or an expression that resolves to a string.
Expression is a data intersection to be resolved as a text string. If no expression is provided, the...
Count
Count
Use this command to return the number of items in a list. This command can be used with either a list variable, symbol, or a file name.
Note: Only those symbols to which the user has access will be included in the return list.
CopySyntax
COUNT (Variable)COUNT ("DimName", "SymName#")COUNT ("ScheduleName", "DimName", "SymName#") COUNT ("FileName")
where:
"Variable" is t...
CreateList
CreateList
Use this Longview Application Framework function to return a list of item names to a list variable.
The CreateList function requires the use of Set Variable List to define the variable to which the function will be returning data. See the syntax examples below.
Syntax
The CreateList function can return a list of any of the following items:
List item
Description
Attributes
A...
Exp
Exp
Use this function in an equation to raise a base value to an exponential power.
For information on using this function in a model, see Exp.
CopySyntax
EXP (Base, Power) (values only)EXP (Power) (calculated as e^power)
where:
Base is a symbol or a constant. The default is the natural logarithm, e (= 2.71828). If Base is a symbol, your system determines the logarithm for each...
FileExists
FileExists
Use this function to determine whether the specified file exists in the specified directory.
CopySyntax
FileExists("FileName")
where:
FileName is the name of the file, including the extension, to search for. In batch mode, the file name must be relative to the current directory. For Longview Smart Client, the file name must be relative to the working directory. You can...
FilterList
FilterList
Use this function to create a new list which is filtered in a specified condition. This function is only available in a procedure as part of the SET VARIABLE command.
CopySyntax
FILTERLIST ("VariableName", "Condition")
where:
VariableName is the name of a list variable.
Condition is a condition that evaluates to a TRUE/FALSE (1/0) result. It can also be an Attribute-...
GetAppConfig
GetAppConfig
Use this function to retrieve an app property value from a simple XML element in the .lvapp file, then return the value as a string. This function is specific to Longview Apps. Currently, retrieving nested elements such as <kars> is not supported.
Note: You cannot use the GetAppConfig function when running in batch mode.
CopySyntax
GetAppConfig ("NameOfProperty")
wher...
GetAttributeDescription
GetAttributeDescription
Use this function to return the description of the specified attribute. The description is returned as a string.
CopySyntax
GetAttributeDescription( "AttrClass", "AttrName" [, "LanguageCode"])
where:
AttrClass is the Attribute class. Select from the following:
AttrClass
Description
SYSTEM
Describes the entire system at the highest level. Attributes...
GetAttributeType
GetAttributeType
Use this function to identify the attribute value type of a specified attribute. The type is returned as a string.
Possible return values include the following:
DATE
DOUBLE
INTEGER
STRING
SYMBOL
DATELIST
DOUBLELIST
INTEGERLIST
STRINGLIST
SYMBOLLIST
CopySyntax
GetAttributeType( "AttrClass", "AttrName" )
where:
AttrClass is the Attribute class. Select from the ...
GetCalcJEStatus
GetCalcJEStatus
Use this function to retrieve the status of a calculated journal entry. The variable type is returned as a Num.
Possible return values include the following:
0 - Does Not Exist - The calculated journal entry does not exist or cannot be retrieved. Non-shared calculated journal entries will not be retrieved for a user that does not have access to the JE.
1 - No Status - The ca...
GetDataTableColumnIndex
GetDataTableColumnIndex
Use this function to retrieve the column index of a specified column in a DataTable object. If the column specified does not exist, the return result is -1.
CopySyntax
GetDataTableColumnIndex (DataTableName, "ColumnName")
where:
DataTableName is the name of the DataTable object in which to get the column index.
ColumnName is the name of the column for whi...
GetDataTableRow
GetDataTableRow
Use this function to retrieve the row contents in a DataTable object. The row to retrieve is specified by the row index.
CopySyntax
GetDataTableRow (DataTableName, RowIndex)
where:
DataTableName is the name of the DataTable object in which to get the row.
RowIndex is the row index of the cell to get.
CopySyntax example
Create Variable EmpDetails[ ] as STRINGCre...
GetDate
GetDate
Use this function to store the current date, in calendar format, in a symbol. You can use Julian date functions to convert the date to a serial number that can be used in calculations. You may find this function useful for keeping track of System Events.
CopySyntax
GETDATE(["Format"])
where:
Format is the formula for another method of returning a date, such as “dd/mm/yyy...
GetDocumentSize
GetDocumentSize
Use this function to return the document size in memory. The document must be loaded into memory, and saved if contents have been modified, when this function is called. The size of a text file in memory is not necessarily the same size as on a file system. If you require the size of a document on the file system, use the function GetFileSize. The GetDocumentSize function is ...
GetFileSize
GetFileSize
Use this function to return the file size on the local accessible file system. This function must be called after the SAVE command.
CopySyntax
GETFILESIZE("FileName")
where:
FileName is the name of binary file enclosed in quotes.
CopySyntax example
Set Variable size = GetFileSize("abc.txt")
GetLockComment
GetLockComment
Use this function to retrieve the comment associated with a particular lock.
A lock is a Longview database security feature preventing access to data currently used by another user.
CopySyntax
GETLOCKCOMMENT("dataspec.lvdsp")
where:
dataspec.lvdsp is the name of the DataSpec file.
CopySyntax example
CREATE VARIABLE TXT as stringSET VARIABLE TXT = GETLOCKCOMMENT("...
GetLockUser
GetLockUser
Use this function to retrieve the name of the user who created a particular lock.
A lock is a Longview database security feature preventing access to data currently used by another individual.
CopySyntax
GETLOCKUSER("dataspec.lvdsp")
where:
dataspec.lvdsp is the name of the DataSpec file.
CopySyntax example
CREATE VARIABLE TXT as stringSET VARIABLE TXT = GETLOCKUSER...
GetMaintenanceUser
GetMaintenanceUser
Use this command to return the ID of the user who currently has maintenance on for the system.
CopySyntax
GETMAINTENANCEUSER()
You can use this command with the Set Variable command to retrieve the user ID and description to variables.
CopyExample
Set VARIABLE userIDmtce = GETMAINTENANCEUSER()Set VARIABLE userDesc = [[USER, DESCRIPTION, $userIDmtce$]]
...
GetNextPeriod
GetNextPeriod
Use this function to return the next symbol in the hierarchy which is a sibling of the specified symbol (if symbol is the last symbol, a blank is returned) in the time periods dimension.
CopySyntax
GETNEXTPERIOD(SymName)
where:
SymName is the name of a symbol in the time periods dimension. The symbol must be a descendent of a symbol specified in either the SGPTimePe...
GetOpenPeriod
GetOpenPeriod
Use this function to return the open period symbol for the year. The function determines the root symbol for the symbol designated by either the SGPTimePerActivity or SGPTimePerYTD attributes, and then returns the symbol whose attribute ZFXTimePerOpenList contains that root symbol. If an open period cannot be found, the function returns a blank. For more information on attribut...
GetPreviousPeriod
GetPreviousPeriod
Use this function to return the previous symbol in the hierarchy which is a sibling of the specified symbol (if SymName is the first symbol, then a blank is returned).
CopySyntax
GETPREVIOUSPERIOD(SymName)
where:
SymName is the name of a symbol in the time periods dimension. The symbol must be a descendent of a symbol specified in either the SGPTimePerActivity ...
GetResourceString
GetResourceString
Use this function to retrieve resource strings from a resource bundle residing on the Longview Data Server. The resource bundle must be loaded into memory before using this token.
You may find this function useful when creating Longview Apps that need to be supported for multiple languages.
The language and culture of the operating system (OS), along with the name of the r...
GetServerWarning
GetServerWarning
Use this function to retrieve “Server has encountered errors” message if the servers have encountered errors due to a failed restatement or other server related errors. If no errors exist, then nothing will be returned.
Note: For more information on Server warnings, see the Longview Server Manager Guide.
CopySyntax
GetServerWarning()
CopySyntax example
CREATE VA...
GetStatus
GetStatus
You can use this function to obtain the status of various server features, such as eliminations, journal entries, schedules, and so on.
These features are specified as either TRUE (activated) or FALSE (deactivated) in the Server configuration file (lvsrvr.cfg). When the server is started, it consults this file and switches these features on or off accordingly.
This function is u...
GetSymbolBalanceType
GetSymbolBalanceType
Use this function to return the balance type of the specified symbol. The balance type is returned as a string. Review the following table for a summary of possible return values and their corresponding status.
Return Value
Description
CREDIT
The symbol has a credit balance type.
DEBIT
The symbol has a debit balance type.
NEITHER
The symbol has neither a credi...
GetSymbolCreatedTimeStamp
GetSymbolCreatedTimeStamp
Use this function to return the created time stamp of the specified symbol. The description is returned as a string in this format "YYYY-MM-DD hh:mm:ss".
CopySyntax
GetSymbolCreatedTimeStamp("dimension", "symName")
where:
dimension is the name of the dimension that contains the symbol.
symName is the name of the symbol whose created time stamp is to be ...
GetSymbolDescription
GetSymbolDescription
Use this function to return the description of the specified symbol. The description is returned as a string.
CopySyntax
GetSymbolDescription( "dimension", "symName"[, "languageCode"])
where:
dimension is the name of the dimension that contains the symbol.
symName is the name of the symbol whose description is to be retrieved.
languageCode is the is the op...