1. Other functions

    Article: AN0002152Updated:

     

    Function name and parameters Function description
    LoginUser('id') Returns id of the logged in user. (Returned value is data type integer.)
    LoginUser('account') Returns login of the logged in user. (Returned value is data type string.)
    LoginUser('name') Returns Full name of the logged in user. (Returned value is data type string.)
    IsUserInRole('role code') Finds out if the logged in user is a member of the role according to the parameter. (Returned value is data type boolean.)This function returns False also in case that the role is not enabled.
    IsPostback() Function returns  True if the record is accessed first time, i.e. it is not a postback. (Returned value is data type boolean.)
    UrlValue('name_of_variable from_url'). Function returns  value of the variable from URL, name of which is in the parameter of the function. (Returned value is data type string.)
    PreviousRowColumn() The function is used in context of a particular column of a class and returns value from the column of the previous record. This function can be used for setting row formatting, if value from the column changed compared to previous record, which makes necessary highlighting.
    GridRrowIndex() Returns order of the row in the list of records. (Returned value is data type integer.) The function can be used e.g. for formatting list of records by means of rules.

    Example:

    Condition (gridrowindex() % 4) = 0 is fulfilled for every forth row in the list.

    Condition ((gridrowindex() - 1) % 6) > 2 is fulfilled for every fourth, fifth and sixth row in the list and then tenth, eleventh and twelfth row etc.
    DataParameter('model code', 'parameter code') Returns parameter value according to the input parameter code. If the model code is not entered, the parameter is searched on ObjectGears level.

    Example:

    dataparameter( '', 'parnumber2') – returns parameter parnumber2 defined on ObjectGears level.
    If(condition, result_true, result_false) The function evaluates the expression in the first parameter and returns the value from the parameter result_true, if the expression is true. In case it is false, it returns value from the parameter result_false.
    CreateEmptyGuid() Returns an empty GUID: 00000000-0000-0000-0000-000000000000 (Returned value is data type GUID/string.)
    CreateNewGuid() Returns unique GUID: (Returned value is data type GUID/string.)
    int? LastJobStatus(string jobcode)

    Function returns status of the last start of the job. If the job was not started yet, it returns NULL.

    The returned value is described at the Job object in the property LastResultStatus.

     

×