SysObject

One SysObject, called Sys, is automatically created. This object is available in all contexts, and provides general functions as well as information about the Data Relationship Management application. There are no properties for this object.

Table 16. SysObject Methods

Name

Description

FormattedDate (value, formatString)

Formats dates according to the Formula system rules. Useful for backward compatibility to exactly match old Formula properties.

  • value must be a Date object or a valid datetime string

  • formatString must be a valid formatting string (see the FormattedDate function)

GetNextID(key)

Returns the next available integer ID for a given string key value

GetPropDef(abbrev)

Returns a PropDefObject for the given property name. The name must be the fully qualified name.

GetRequestByID(int)

Returns a workflow request by ID.

GetSysPrefValue(abbrev)

Returns the value of the given system preference (for example, HierNodeSeparator)

InRange(dataType, input, min, max, minExclusive, maxExclusive)

Corresponds to the formula function InRange. Required parameters are dataType, input, and min.

IsNodeAbove(ancestor, child)

Returns True if ancestor is above child in the hierarchy. Returns False if parameters are not LocalNodeObjects or are not in the same hierarchy.

IsNodeBelow(descendant, parent)

Returns True if descendant is below parent in the hierarchy. Returns False if parameters are not LocalNodeObjects or are not in the same hierarchy.

RunFormula(node, propDef, formulaString)

Runs a Data Relationship Management formula and returns the string results

  • node is either a NodeObject or LocalNodeObject. Your formula string must not make references to local properties when passing in a NodeObject, or an error will result. When passing a LocalNodeObject, you can reference all available global and local properties.

  • propDef––To be parsed or executed correctly, some formula functions require a property definition. When you use those functions, you must supply a property definition. Generally, the property definition characteristics (like Level, Global vs Local, and Type) must match, but it doesn't have to be the actual property that the formulaString is for. They can be unrelated. In most formulas, you can pass null for this parameter. Syntax is Sys.GetPropDef(abbrev).

    Example

    Sys.RunFormula(node, Sys.GetPropDef("Custom.MyProp1"), "Concat(Prop value ', PropValue(Custom.MyProp2),' ,is, ,valid)");
  • formulaString is a legacy Data Relationship Management Formula; white space is considered a literal part of the Formula so it must be removed if necessary.

    Note:

    This is not considered a best practice and should be used only when necessary to achieve an exact match with legacy behavior. Performance is decreased when using this method.