Accept Fields

Accept fields are input fields in tstructs with Mode of entry as Accept. By default, the user will be allowed to enter any value into this field at runtime.

Expressions in Accept

  • You can attach an expression to the field using the Expression property of the inputfield. You can use the existing fields in the TStruct  or any of the global application variables in the expression.
  • Only a valid date can be entered in date type fields.
  • A numeric field will allow user to enter only positive, negative and decimal numbers. To restrict user to accept only positive numbers, set the onlypositive property to true. If the number of decimals is set to zero, then only whole numbers can be entered.
  •  If an expression is attached to a field,the result of the expression is set as its value if the field value is empty. The user can change the calculated value. 
  •  All fields that are placed before this field can be used in an expression.
  • System variables and application variables can be used in the expression.
  • Fields used in an expression are called parent fields. The field in which the expression is defined is called the dependent field. When parent fields are changed all its dependent fields are refreshed.

SQL statements in Accept

  • Click on the Details property of the inputfield to attach an SQL to the field.
  • At runtime, the value in the first column first row of the SQL result will be populated as its field value.
  • If the user wants to change the value that is auto populated using SQL,the Suggestive property should be selected. The changed value is retained only if the suggestive property is set to true.
  • In case the end user wants to fire the SQL every time a transaction is entered, select the Refresh On Save check box .The AutoSelect option if enabled will display the first value of the result set in the field.
  • If an  SQL statement is attached to an Accept field, all fields that are before this field can be passed as parameters to the SQL.
  • System variables & application variables can be passed as parameters to SQL.
  •  Fields that are passed as parameters are called parent fields. The field used in SQL as parameters are called dependent fields. When parent fields are changed, all its dependents are refreshed.

Important Rules

  1. When a parent and dependent fields are both in the same grid, the parent value in the current row is used to refresh the dependent value in the current row.
  2. When a parent field is non grid & dependent is in grid, all the values in the dependent column are refreshed.
  3. When parent is in grid and dependent in non grid, when value of any row in the parent is changed, the value in the non grid is changed.
  4.  A row in a grid may have many dependent fields outside the grid. When a row is deleted in a grid DC, all the dependent non-grid fields are refreshed.