HELP!

Accessing Object Properties

Variable Objects (derived from a Base Class) can have user-defined properties as well as system properties, which can both be accessed via one of two ways (.props Property or .prop Method):

Using the .props Property

if (#Grade.props.description === "") {
    #Grade.props.description = "Boss Type"; 
}

Using the .prop Method

This can be called with 1 or 2 parameters:

  • .prop(object property name) Get the value of the specified object property
  • .prop(object property name, new value) Set the value of the specified object property to the new value

When setting a new value, via either the props object or the prop method, the type of the new value must match that of the Viabl Platform Object property.

#Age.prop("minvalue", 22) ;
#Age.prop("allowblank", true);

The .prop method is useful if the property name is variable

var mypropname = "description";
var mypropvalue = "What is the employee's grade";
if (#Grade.prop(mypropname) === "") {
    #Grade.prop(mypropname, mypropvalue); 
}

You can also get and set Dialog properties via the dialog Object's .prop method

On This Page