Defining default values

Filter definitions can be used to automatically enter default values when creating new records.

Note: Core default values defined in the CRM win Rights module are used when saving the record and only if the respective field is empty.

media/image96.png

You can use catalog values, constants, $cur expressions and $par expressions (i.e. variables that are determined by a parent record).

For a complete description of the $ expressions (syntax and examples), see $cur expressions.

Note: If you want to use linked fields in a template filter, you need to pass the link to the field's info area in the action, otherwise, these fields will be ignored.

Boolean Fields

Any value except "N" evaluates to true.

Date/Time filters

In addition to $cur expressions ($curRep, $curDay, etc.) you can use $par expressions to get dates and times from parameters, e.g. $parDay:fdWeek is the first day of the parameter's week. The parameters are defined in the info area's default List control/ see Variable Defaults.

You can use date and time calculations for both $cur and $par expressions:

  • $curDay+1y+1d evaluates to tomorrow next year
  • $parDate:fdWeek+7d evaluates to first day of the week of Date plus 7 days.

Multiple Default Values

You can define multiple default values (fallbacks) for one field by adding $onlyFirst as the first value:

media/image97.png

The first expression that does not evaluate to null (or empty) is used. In the above example: If the parameter Date is defined and has a value (i.e. not empty), it is used. If Date is undefined or empty, the current date is used.