2017 October Release

Getting and setting property valuesPermanent link for this heading

Syntax

// Getting property values using the assignment operator
variable = object.property;

// Setting property values using the assignment operator
object.property = expression;

// Setting values of a compound property list using the assignment operator
// The values are assigned based on their position

object.property = [{ val1, val2, ... }, { vala, valb, ... }, ...];

// Simple initialization of compound properties
CompoundType compoundtype = { val1, val2, ... };
CompoundType({ val1, val2, ... });

// Setting values of a compound property list using the assignment operator
// The values are assigned based on their position

object.property = [{ val1, val2, ...}, { vala, valb, ...}, ...];

// Setting values of a compound property list using the assignment operator
// The values are assigned based on the properties of the compound type

object.property = [{ reference1 = val1, reference2 = val2, ... }, ...];

// Setting values of a compound property list using the "JavaScript" notation
// The values are assigned based on the properties of the compound type

// The right sight

object.property = [{ reference1 : val1, reference2 : val2, ... }, ...];

// Getting property values using the Get... functions
variable = object.GetAttributeValue(transaction, property);
variable = object.GetAttribute(transaction, property);
variable = object.GetAttributeString(transaction, property, language);
variable = object.GetAttributeStringEx(transaction, property, language,
  additionallist, displayflags);

// Setting property values using the Set... functions
object.SetAttributeValue(transaction, property, index, value);
object.SetAttribute(transaction, property, value);


Note: You can set the value (currvalue) of a currency property (compound type) by just assigning a string, float or integer to the currency property (currency @cur = 7.56;). In this case it is not necessary to specify explicitly the currvalue property (@cur.currvalue = 7.56;).

You can use the assignment operator = to get and set the value of a property. Even though using the assignment operator is recommended, you may also use the following functions to get and set property values:

  • The GetAttributeValue function is used for retrieving a scalar property value.
  • The GetAttribute function is used for retrieving a list.
  • The GetAttributeString function is used for retrieving a string representation of the property value. This function can be used for retrieving multilingual strings in the desired language.
  • The GetAttributeStringEx function is used for retrieving a string representation of the property value. This function allows you to specify so-called display flags (see next table) for the value to be retrieved.
  • The SetAttributeValue function is used to store a scalar value in a property.
  • The SetAttribute function is used to store a list.

Value

Description

0x0001

Object address

0x0002

Object reference

0x0004

Enumeration reference

0x0010

XML escaped

0x0020

HTML escaped

0x1000

Row list

0x2000

Column list

0x8000

No list indicator

Table 50: Display flags for GetAttributeStringEx

Example

@orders = @customer.APPDUCXSAMPLE@200.200:customerorders;

@orders = @customer.GetAttribute(cootx, #APPDUCXSAMPLE@200.200:
  customerorders);

@orderdate = @order.GetAttributeValue(cootx, #APPDUCXSAMPLE@200.200:
  orderdate);

@order.APPDUCXSAMPLE@200.200:orderdate = coonow;

@order.SetAttributeValue(cootx, #APPDUCXSAMPLE@200.200:orderdate, 0,
  coonow);

@engname = @product.GetAttributeString(cootx, #mlname, #LANG_ENGLISH);
@gername = @product.GetAttributeString(cootx, #mlname, #LANG_GERMAN);

@description = @product.GetAttributeStringEx(cootx, #APPDUCXSAMPLE@200.200:
  productdescription, null, null, 0x1000);