Event.Form.Inputs(FID).Focus()

.Focus() allows you to set the cursor and focus of the form on the Input field you would like. This is particularly helpful if your data entry process branches based on the data entered into the current field

Applies To

Properties and Methods

None

Available

The .Focus() method is available in:

  • 16.07.024
  • 17.00.007
  • All newer builds

Note: The .Focus() method and all sub-classes, properties, and methods are only available in Form Layout scripts.

Type

Method

Syntax

Event.Form.Inputs(FID).Focus();

Parameters

None

Example

//--Set the focus() on the to_billpo if that is checked on the Bill-to company

//--otherwise set it on the facility (to_waid)

//--This script would be on the to_ordtype change event.

Event.Base();

let lnBiid = Event.Form.Inputs('Input_eTORD_to_biid').Value;

 

//--Always clear and set parameters when using data in a WHERE clasue!

Query.ClearParamters();

Query.AddParameter(lnBiid);

let llPO = Query.GetBoolean(`SELECT bi_poreqd FROM dmbill WHERE bi_id = {0}`);

let lcFID = (llPO ? 'Input_eTORD_to_billpo' : 'Input_eTORD_to_waid');

Event.Form.Inputs(lcFID).Focus();