Liquid UI - WS Reference Library

4.2.12 Database Declarations


All screens and screen elements are created based on definitions contained in the database of the Master Record - Addendum. When a project is created from scratch, the user is able to define his or her own data tables in the database definitions, as well as defining the screen elements that will be displayed.

Indexing is based on the database definitions and each time new metadata is added to a database or removed from a data table, the indexing will change. If a user creates a new screen element by assigning a new index value and then creates new metadata in the data table, the new screen elements will return an error.

Within the Master Record - Addendum database definitions, users can define metadata either as an element of a data table or as a screen element that will be visible on the screen. For example, a user can define a screen element and give it an attribute to make it a screen-only field, as shown in the example code below:

g_WorkOrderAppDesc.Addendum.Database = [
{label:"Order",fieldname:"g_wo_no",displaywidth=8,fieldlength=10,sharedfield:1},
{label:"Activity",fieldname:"g_wo_activity",displaywidth=8,fieldlength=10,sharedfield:2},{label:"Location",fieldname:"g_wo_location",displaywidth=8,fieldlength=30},
{type:SCR_PUSHBUTTON,label:"@xx@label",position:{row:1,col:1,height:1,width:5},fcode:"=fcode",screenonly:1},
{type:SCR_FUNCTION,funcname:"=fcode",callback:function( ){ },screenonly:1}]

As previously explained, the various attributes are as follows:

  • Sharedfield: Used to determine if a field is shared with more than one screen. If so, the field is used in the PBO function to capture the data and display it in the additional screens.
  • Showintable: Determined whether or not a field needs to be displayed in a table control.
  • Downloadkey: Determines what constitutes the unique key to download data to Offline.
  • Screenonly: Determines whether or not the created screen is part of a data table of is used for display only.