Skip to content

Set a default value

How-to6 minPractitioner

Before you start

Set a default value when most records start with the same value, such as a quantity of 1 or a request source of “Employee portal”. The default can be plain text or a Smart Script. Beezr applies it when a record is created and the field is empty.

  1. Open Modules, choose the module, and click the field’s row on the Fields page. The editor opens.
  2. Scroll to Default value and click + Add a default value. A script box opens.
  3. Type the value. Use Ctrl + Space for suggestions.
  4. Click Save field.

The Default column of the Fields page now shows a tick for the field. Point at the tick to see the value.

The bottom of the field editor for Contract Value, with the Default value section showing the link + Add a default value and the note that it is applied when a record is created.
    + Add a default value opens the script box.
    Save field keeps the default.

To remove a default, open the field, click Remove default under the script box, and save. The key field has no Default value section.

You can type plain text or a Smart Script. Beezr runs what you type as a script. If it isn’t valid script, Beezr uses the text exactly as typed.

You wantTypeField type
Every request to start as an employee requestEmployee portalText
A quantity that starts at 11Integer
A title built from two other fieldssee the script belowText

A script can read other fields on the record. Write the full token, $table$.$field$, and copy the table name from the Modules page. Text fields arrive already in quotes, so you add none of your own.

$cm_equipment_requests_base$.$item$ + ' for ' + $cm_equipment_requests_base$.$requested_for$

When a script does arithmetic, wrap each field in parseInt() or parseFloat(), with no quotes around the token.

parseFloat($cm_invoices_base$.$net_amount$) * 0.15

Two things happen, and which one you see depends on the type.

TypeOn the form when it opensAt save
Integer, Long, DecimalThe default, run as a Smart Script. 0 if there is noneIf the field is empty
BooleanThe default as typed. false if there is noneIf the field is empty
Lookup, Multi select lookup, User, Content, Multi content, SignatureThe default as typedIf the field is empty
RelationThe default, only when it has no $...$ tokenIf the field is empty
Text, Text area, Rich text, Currency, Date, Date time, Link, Rating, BarcodeFilled in when savedIf the field is empty

A default on a Text field appears once the record is saved with that field left empty. Test it by saving a new record.

For a number worked out from other fields, use a smart field.

Check yourself

Karim gives the Quantity field (Integer) no default value. What does a new record's form show?
Show the answer

0. When an Integer, Long or Decimal has no default, the form starts it at 0.

Nour sets a default on a Text field. When does Beezr apply it?
Show the answer

At save, if the field was left empty. Text fields are not filled in when the form opens. Beezr applies the default when the record is saved and the field is still empty.

What's next

Last checked