View Article

Add Default Values

By Xelence Documentation posted 09-03-2021 10:25

  

Introduction

Default values are values that automatically populate a field on the application side every time the form is opened to create a new record. (This is applicable only when you create a new record, as it does not change the values when you open an existing record.) This saves data entry and therefore time and typos. For example, you know a field should always, or at least often, be the first day of the next month. You can make the application populate that field with that date every time the form opens.

Prerequisites

  • The form you are editing must already exist.
  • The control you are configuring with a default value must already exist.
  • If your default value requires a query to populate, that needs to be configured in the entity. 
  • If your default value requires a method to populate, that needs to be configured in the entity.
Quick Steps
1 Open the desired container
2 Update the properties for the field you want to add default value to
3 Save the form

Detailed Steps

Step 1. Open the desired container.

In this case, that's the Order tab on the Demographics section.



Step 2. Update the properties for the field you want to add a default value to.

If your form doesn't already have a field to populate with a default value, you can add one. This example adds a Required Date field.



Update the properties for the field. The important properties are:

  • Default Type: The kind of data the field uses.
  • Default Value: What the application populates the field with. Default Value is required if the Default Type is neither a date nor text. This example uses a scalar query to populate the field, so the Default Value is a query from the entity.


The query comes from the entity. It must exist there before you can use it here. Make sure to change the Query Type to ScalarQuery.



Step 3. Save the form.


Then, run the Preview. Xelence displays the form output. You can test your updated settings.

When you have previewed your form, it should look something like this. When you create a new record, the application automatically populates the field with the configured default value.


What are the improvements over S3 Version 6?

The process is identical.


This post is part of the Maintenance Form topic. Click here to open the Maintenance Form Overview.


#Xelence

#Forms

0 comments
83 views