OSTENDO
Reference Guide

User Defined Defaults


File: > Customisation Configuration -> User Defined Defaults

The idea of this feature is to allow you to defined default field values. This can be useful when setting up new records be they Orders, Customers, Supplier, Items etc..  These User Defined Defaults can occur when a new record is 'Inserted' into the database or when an existing record is Updated.

This frees up the user to simply focus on specific fields when entering a new record or order etc.. thereby leaving Ostendo to manage the default field values defined for the organisation.

This feature avoids the need for defining Required Fields, Custom Triggers and Screen Data Scripts in order to force a field value.

There are four methods that control when a Default Field Value can be used:

eg: JobHeader.SalesPerson (aliases may be used to abbreviate table names 'OTHER'  than Primary Table Name)

When defining a User Defined Default with 'From and Conditional' Clauses it is suggested you first test your syntax in the Data Spreadsheet (General -> Data Spreadsheet) feature of Ostendo prior to implementing the default values rule.

eg:

Select Jobheader.SalesPerson fromJOBHEADER,CUSTOMERMASTERwhereJOBHEADER.CUSTOMER = CUSTOMERMASTER.CUSTOMER and CUSTOMERMASTER.CUSTOMERTYPE = 'Services' and JOBHEADER.JOBCATEGORY = 'Plumbing'

Suppose we want to default the field SALESPERSON value to "Jane Steel" if that field is left blank when a new Customer is added.

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

CUSTOMERMASTER

SALESPERSON

On Insert when Blank

Jane Steel



Active For All Users


Suppose we want to default the field ADDITIONALFIELD_1 value to "12345" if that field is left blank when a new Item is added.

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

ITEMMASTER

ADDITIONALFIELD_1

On Insert when Blank

12345



Active For All Users


Suppose we want to default the field JOBCATEGORY value to "Repair" if that field is left blank when a new Job is added or updated.

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

JOBHEADER

JOBCATEGORY

On Insert and Update when Blank

Repair



Active For All Users


Suppose we want to default the field SALESPERSON value to "Jane Steel" if that field is left blank and when the Customer Region is set to'Asia'when a new Customer or updated.

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

CUSTOMERMASTER

SALESPERSON

On Insert and Update when Blank

Jane Steel

CUSTOMERMASTER

CUSTOMERREGIONCODE = 'Asia'

Active For All Users


Suppose we want to default the Job field SALESPERSON value to "Bob Drum" if that field is left blank and when the Job Customers Customer Type is set to 'Services' and where the Job Category is set to 'Plumbing' when a new Job Order is Created or updated.(Note the optional use of an alias of 'CM' on the CUSTOMERMASTER table)

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

JOBHEADER

SALESPERSON

On Insert and Update when Blank

Bob Drum

JOBHEADER,

CUSTOMERMASTER CM

JOBHEADER.CUSTOMER = CM.CUSTOMER and CM.CUSTOMERTYPE = 'Services' and JOBHEADER.JOBCATEGORY = 'Plumbing' 

Active For All Users


Suppose we want to default the Job field ADDITIONALFIELD_1 value to the currentCustomer Regionfield value of the Job Order Customer if that field is left blank and when the Job Category is set to 'Plumbing' when a new Job Order is Created or updated.

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

JOBHEADER

ADDITIONALFIELD_1

On Insert and Update when Blank

[CUSTOMERMASTER.CUSTOMEREGIONCODE]

JOBHEADER,

CUSTOMERMASTER

JOBHEADER.CUSTOMER = CUSTOMERMASTER.CUSTOMER  and JOBHEADER.JOBCATEGORY = 'Plumbing' 

Active For All Users


Suppose we want to default the field ABCCLASS value to "B" always on insert if the Analysis Group is set to'Materials'when a new Item is added. (NB: The ABCCLAS never defaults to Blank)

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

ITEMMASTER

ABCCLASS

On Insert Always

A

ITEMMASTER

ITEMMASTER.ANALYSISGROUP = 'Materials'

Active For All Users


Suppose we want to force the field Workflow Status value to "Goods In Picking" when a new Sales Delivery is created.

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

SALESDELIVERYHEADER

WORKFLOWSTATUS

On Insert Always

Goods In Picking



Active For All Users


Suppose we wish to influence the Job Order Status when we create a new Job for an Asset which has an Asset Type ='Equipment'. In this example after the order is initially created we will update the Order Status to 'Quote' if the Condition is met.

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

JOBHEADER

ORDERSTATUS

On Insert Always

Quote

JOBHEADER, CUSTOMERASSETMASTER

JOBHEADER.CUSTOMER = CUSTOMERASSETMASTER.CUSTOMER and 

JOBHEADER.PROJECTORASSET = CUSTOMERASSETMASTER.CUSTASSETNAME and CUSTOMERASSETMASTER.CUSTASSETTYPE = 'Equipment' 

Active For All Users


Suppose we always want to force a field value of "Assembly" to the SOURCEDBY field if the Item Category = 'Wagons'

Table Name

Field Name

Default When

Default Field Value

From Clause

Conditional Clause

Rule Status

Restricted User

ITEMMASTER

SOURCEDBY

On Insert and Update Always

Assembly

ITEMMASTER

ITEMMASTER.ITEMCATEGORY = 'Wagons'

Active For All Users