How You Default a Field Value

You use the Assign Value to Field statement to default a field value. You can have more than one such statements in a rule when all the defaulted fields are part of the same current object in context.

When assigning a value to a business object attribute, the operand types can be any one of these:

  • Business Object Attribute - This always shows the same attribute as that on the left hand side. Click the hyperlink to change to another business attribute field from the current or related objects. You can then see attributes of current or related objects of the same data type as that of the left hand side operand.

  • Literal - This is the default and changing to this operand type in the context of a default statement enables you to code the value to assign to the selected attribute. The literal appears as a text box and is based on the data type of the operand on the left hand side (the attribute being defaulted into).

  • Existing Variable - When selecting this type of operand, the variables that have already been explicitly defined within the scope of the current rule line, which are of the same data type as that of the left hand side attribute (the field being defaulted into) are shown. If matching data type variables aren't available, you get an error message preventing you from changing the operand type to existing variable.

A fourth option for Operand Type, arithmetic expression, is available but not used much in most functional situations. You must define variables of compatible numeric types and perform arithmetic operations prior to assigning the existing variable to the field to be defaulted (as opposed to attempting an arithmetic operation during defaulting).