o4w:oi10:reference_guide:o4w_form

O4W Form

Create/Modify

From the O4W Main Menu choose O4W Menu.

From the O4W Form menu choose Create/Modify.

From the Form Selection tab you can select an existing O4W Form to modify from the drop down box, an existing OpenInsight form to convert or you can enter the name of a new form to create. Click the Next button to continue.

We will now explore each component on the Layout tab.

A textbox is provided to enter a description of the form.

Choose the table to be associated with this form from the drop down list. This drop down list will contain all tables attached to the application that O4W is logged into.

A textbox is provided to enter the title of this form.

All the O4W wizard routines (O4W Forms, O4W Reports, O4W Dashboards, etc.), as well as the O4W API’s, allow the developer to specify one of more “templates” on which their output can be displayed. A template contains all the additional html elements needed to generate the full web page that a browser can display. This includes images, colors, and style elements that both surround, and may be used by, the O4W routine’s output. O4W includes several sample templates . These templates are stored in the TEMPLATES directory located within OpenInsight at \Revsoft\OInsight\O4W\TEMPLATES.

A textbox is provided to enter the path of a background image to use as a watermark for each page of the form. Textboxes are also provided to enter the form header and footer. You can also select the O4W Menu to display on this form. Select None to not display any menu.

A color picker control is provided to select the background color, foreground color, link color and visited link color to be used on the form. You can either choose one of the colors provided or enter a specific hex color value or color name.

General form alignment can be chosen from the radio button set provided. An option to show borders around each cell is also provided.

Links can be provided at the bottom of every page on a form. Enter the link text in the textbox provided and the specific URL in the associated textbox. A description of Link To options can be found at the back of this reference guide.

We will now explore each component on the Behavior tab.

One of the behavioral characteristics of the form that must be defined is how records are to be retrieved. The choices are:

· OI Form Mode – The O4W form can behave like an OI form, allowing you to use “QBF” for searching and selection of records. In this mode, there is no separate “collector” window created to enter the key and/or search values

· Picklist – All records in the associated table for this form a displayed for key selection

· Entering Key – The user must enter the record key

· Search – The user will search for records based upon criteria provided

· Key and Search – The use can either enter the record key or search for records based upon search criteria provided

· None – Add Records only – An entry form is provided and the record key is programmatically or automatically assigned. The user must press a button to launch the form

· None – Add Records Only (Without Button) - An entry form is provided and the record key is programmatically or automatically assigned.

A textbox is provided to enter the number of parts in the key field.

Enter your form permissions from the drop down box. You can create additional menu permissions in the O4W Maintenance section of O4W.

The Allow Editing drop down box has the following three choices:

One of the behavioral characteristics of the form that must be defined is if this form will allow the entry of new records. The choices are:

· Yes, with internal DATE as key – The record ID will be the system internal date

· Yes, with internal DATE*TIME as key – The record ID will be the system internal date and time separated by an asterisk

· Yes, with user-entered key – The end user will enter the record ID

· Yes, with counter as key – A sequential counter will be used to generate the record ID

· Yes, with stored procedure generated key – The form will call the stored procedure provided to generate a new key. The stored procedure should have 3 parameters. The first parameter should be set by the stored procedure to the new key. The second parameter will be passed in by the O4W form runner and will be the name of the table used by the currently-executing form. The third parameter will be the contents of the record that the O4W form runner is about to save.

· No – The form will not allow the entry of new records

Record deletion can be controlled by choosing the Yes/No radio button.

You can choose the location of the Save/Delete/Next buttons.

Since O4W uses a special type of “web-friendly” locking, known as “optimistic locking”, it is possible that the record will be changed or locked by another user when the O4W Form is ready to write the modified or new record. The form can check if a record ID is locked, or has been modified by another user, and allow a retry in this case. The user will be prompted to enter a new record ID under which their changes should be written.

Some of the behavioral characteristics of the form that must be defined is if this form will call a commuter module for events on the form, if the form will allow editing, if the form will allow record deletion and the location of the Save/DeleteNext buttons. Specific form events to call the commuter module can be selected. For event behaviour see the chapter O4W Form Commuter Module.

If desired, select the previously defined O4W-controlled RSS feed(s) you wish to update when records are updated, created, or deleted by this form.

Select the form-level events that will be passed into the commuter module (if any). The form runner can call the commuter module when the form is first being processed and before any display has taken place (CREATE), before selecting results from any search criteria (SELECT), or after (READY) the form has been rendered, before (PRE-READ) or after (POST-READ) the individual record has been read, before (PRE-WRITE) or after (POST-WRITE) the individual record has been updated, before (PRE-DELETE) or after (POST-DELETE) the individual record has been deleted, when a tab has been clicked (TAB), after a popup has returned a value (POPUP), and after the individual record has been displayed (POST-DRAW)

We will now explore each component on the Groups tab.

Associations are groupings of fields. Multiple associations can live on a single tab. A typical association would be a set of “associated” multivalue fields. You can also group non-multivalue fields together in an association, because you want them to be logically grouped together. The smallest “logical grouping” in an O4W Form is an association. When an O4W form is run, O4W tries to build its display tables (on each tab) based on each association you have defined. However, if you ‘mix up’ the fields that are defined in an association – say, some are multivalued and some are not; or some are displayed over/under and some are displayed side-by-side – O4W will split them apart. It will make your single association into a few ‘sub-groupings’, where each subgroup has the same properties – either all single valued, or all multivalued; and either all over/under, or all side-by-side. The components of an association are as follows:

· Association Name – A logical name you assign to an association

· Title – An optional title applied to an association. If applied the title will display above it’s association

· Desc – An optional description which would be displayed if the users mouse “hovers over” the association title

· Add Button? – The choices are: None, Top (Add button placed at the top of an associated multivalue set), Bottom (Add button placed at the bottom of an associated multivalue set), Both (Add button placed at the top and bottom of an associated multivalue set)

· Del Button? – The choices are: None, Top (Delete button placed at the top of an associated multivalue set), Bottom (Delete button placed at the bottom of an associated multivalue set), Both (Delete button placed at the top and bottom of an associated multivalue set)

· Ins/Del on Row? – The choices are: None, Ins (An Ins button will be placed to the left of an associated multivalue set to insert a row; the row will be inserted immediately before the row where the button is located), Del (A Del button will be placed to the left of an associated mutlivalue set to delete that row), Both (An Ins and Del button will be placed to the left of an associated multivalue set).

· Allow Rearrange – Provides the ability to rearrange the rows in this association, both graphically on the screen and within the associated set of multivalue fields

· Table Width – If desired, a fixed table width can be set by entering the pixel width, followed by a “px” to represent “pixels” (ie, 400px)

· Table Height – If desired, a fixed table height can be set by entering the pixel height, followed by a “px” to represent “pixels” (ie, 400px)

· Scroll If Too Big? - If a fixed table width or height has been specified, and the table data exceeds that width or height, specifies that a scroll bar (or both a horizontal and vertical scroll bar) should be displayed

· Table Border – Provides the ability to place borders around this association

· Zebra Stripe – Provides the ability to alternate shading between each row of this association

· Delete Association – Clicking the Del button will delete this association

· Add Association – Click this button will add a new association

· Default width for automatically defined associations – Enter the pixel width, followed by a “px” to represent “pixels” (ie, 400px), for the group that contains all fields not specified in a named group

· Default height for automatically defined associations – Enter the pixel height, followed by a “px” to represent “pixels” (ie, 400px), for the group that contains all fields not specified in a named group

Tabs are physical ‘pages’ on the form. Each tab is one ‘page’ of fields. A form can be defined with no tabs (a single page) or multiple tabs. A textbox is provided to enter the default tab name. Additional tabs may be added to the form by clicking the Add Tab button. A tab may be deleted by clicking on the Del button. Additionally Back/Next buttons for tab movement can be displayed on the form by selecting the checkbox provided.

A form can contain fields that are not bound to the table associated with this form. A textbox is provided to enter User Field Names. New User Field Names can be added to the form by clicking the Add User Field button. User Field Names may be deleted from the form by clicking the Del button.

We will now explore each component on the Fields tab.

The Add Field To… multiline textbox contains all the dictionary names contained in the table associated with this form as well as all User Field Names.

Fields must be selected for three categories: Search/Select, Display on Tab and Display in Association. For Search/Select Fields:

· Choose the items to search on from the Add Field To box and click the Search button to add fields to the Search Fields section. Click the Remove button under the Search Fields section to remove search fields.

· Choose the items to display search results from the Add Field To box and click the Results button to add fields to the Search Result Fields section. Click the Remove button under the Search Result Fields section to remove search result fields.

For Display on Tab:

· Choose the items to appear on All Pages from the Add Field To box and click the All Pages button to add fields to the All Pages section. Click the Remove button under the All Pages section to remove fields from the All Pages section.

· Choose the items to appear on a specific Tab from the Add Field To box and click the button with the Tab Name to add fields to that Tab. Click the Remove button under the Tab Name section to remove fields from that Tab.

For Display in Association:

· Choose the items to appear in a specific Association from the Add Field To box and click the button with the Association Name to add fields to that Association. Click the Remove button under the Association Name section to remove fields from that Association.

We will now explore each component on the Search tab.

If this form has a multipart key each Key Part will be displayed. You can select the appropriate dictionary item for each specific key part.

If you want the end user to enter the record key you can enter the Key entry prompt text. If you want an Explicit Value for the record key enter it in the textbox provided. If you want to call a Stored Procedure to generate a record key enter the name of the stored procedure in the textbox provided.

For the “key part” stored procedure, the parameters are:

Subroutine MyRoutine(formName, KeyPartNumber, keyPart)

Where “MyRoutine” is the name of the stored procedure you have created, formName is the name of the O4W Form (passed in), KeyPartNumber is the number of the key part that this should return (passed in), and keyPart is the key (or part of the key) (returned from your stored procedure).

If you want to utilize your own routine to do a record search enter the stored procedure name in the textbox provided. The search stored procedure should have three parameters. The first parameter is a list (@FM-delimited) of the dictionary field names the user has been prompted for. The second parameter is an associated list (@FM-delimited) of the values the user has entered in response to the prompts. The third parameter is the @FM-delimited list of keys that your stored procedure generates as the results of the search.

Search fields are displayed in the order that they were selected. You can change the display order by left clicking on a field and dragging that field to a new position.

The search types provided are:

· UPPER-CASE - All entered data is converted to upper-case.

· lower-case – All entered data is converted to lower-case.

· Unchanged – All entered data will be searched on as entered.

· Case-Insensitive – Specific case will not be utilized for searching.

The search comparison types are as follows:

· <implicit> - user can enter a comparison operator and value

· equals - =

· greater or equal - >=

· less or equal - ⇐

· greater - >

· less - <

· starts with – ] xxxx

· ends with – [ xxxx

· contains – [] xxxx

· is not equal to - #

Enter the prompt text for each item in the textbox provided.

If Yes is selected and no data is entered for this selection criteria the selection option is skipped.

If the user should be allowed to enter multiple values for the selection value, select Yes from the “Multiple Selection?” column. If a list of possible values is displayed (either programmatically or because the current field is indexed), multiple selections can be made by holding down the shift or control key when clicking; if a textbox is displayed, multiple values can be entered by comma-delimiting them in the textbox.

If this is an indexed field you can set the maximum number of records to display in the dropdown list.

You can set the index display order.

We will now explore each component on the Selection tab.

You can specify the number of lines/page to display for the search results. The default is 10 lines per page.

The fields to display after the search appear in the order that they were selected. You can change the display order by left clicking on a field and dragging that field to a new position.

The field label will default to the dictionary label. You may enter your own label in the text box provided.

The Label Properties can be modified by clicking on the button.

Change ALL label properties to match this? – If this box is checked, all label properties for Search Fields will be duplicated. You can set the column width by entering a pixel value, followed by “px” (for example, 400px). A color picker control is provided to select the label background color and foreground color for the search display results. You can either choose one of the colors provided or enter a hex color value or name.

We will now explore each component on the Edit/Display tab.

The fields to display on each tab appear in the order that they were selected. You can change the display order by left clicking on a field and dragging that field to a new position.

Each field label will use its dictionary description by default. You can change the label description by entering the label text in the textbox provided.

You can set the Label Display Properties for each field by clicking the button.

We will now explore each component for setting Label Properties:

· Change ALL label properties on the current tab to match this? – If this box is checked, all label properties for fields on this tab will be duplicated.

· Font name: - You can specify a font name for this label (e.g. Tahoma)

· Background Color: - A color picker control is provided to select the label background color. You can either choose one of the colors provided or enter a specific hex color value.

· Text Color: - A color picker control is provided to select the label text color. You can either choose one of the colors provided or enter a specific hex color value.

· Alignment: - Label text can be aligned within a cell with left, center or right justification.

· Label/Value Position – You can position the label/values either side-by-side or over/under. Over/Under is typically used for multivalue associations.

· Label Width - You can set the label width by entering a pixel value, followed by “px” (for example, 400px).

You can set the Value Display Properties for each field by clicking the button.

We will now explore each component for setting Value Properties:

· Change ALL value properties on the current tab to match this? – If this box is checked, all value properties for fields on this tab will be duplicated.

· Font name: - You can specify a font name for this value (e.g. Tahoma)

· Background Color: - A color picker control is provided to select the value background color. You can either choose one of the colors provided or enter a specific hex color value.

· Text Color: - A color picker control is provided to select the value text color. You can either choose one of the colors provided or enter a specific hex color value.

· Text Alignment: – Values can be aligned within a cell with left, center or right justification.

· Control Alignment: – Controls can be aligned within a cell with left, center or right justification.

· Bold? – If checked the value will be displayed in a bold font.

· Italic? – If checked the value will be displayed in an italic font.

You can set the Value Input Display Details Properties for each field by clicking the button.

We will now explore each component for setting Input/Display Properties for an Input type: Plain text (not editable).

If the data associated with this value is multivalue, check this box.

If this field is a record key, check this box. If this field is part of a multi-part key, enter the key part in the textbox provided For single part keys enter ‘0’.

Each field must be defined with an Input type. The Input types are as follows:

· Plain text (not editable – This field will be defined as non editable, no data entry allowed.

· Textbox – This field will utilize a textbox control for data entry.

· Password – This field will utilize a password textbox control for data entry. The typed characters are not displayed.

· Radio Buttons – This field will utilize a radio button control for data entry. Only one radio button can be selected.

· Checkboxes – This field will utilize a checkbox control for data entry. Multiple choices may be selected.

· Listbox – This field will utilize a listbox (dropdown) control for data entry. Only one row can be selected.

· Combobox – This field will utilize a combobox (dropdown) control for data entry. Data can be entered in the textbox provided as well as selecting from the listbox.

· Type-ahead Listbox – This field will utilize a type-ahead listbox control for data entry. As data is entered the results in the listbox are refined.

· Multiline Text – This field will utilize a multiline text control for data entry.

· Date picker – This field will utilize a date picker control for data entry.

· Color picker – This field will utilize a color picker control for data entry.

· Time picker – This field will utilize a time picker control for data entry.

· File upload – This field will utilize a file upload control for data entry.

· Hidden textbox – This field will not be displayed, but the original value of the field will be stored in the browser page and retrieved when the record is updated.

You can specify a specific output conversion code by entering in the textbox provided or use the dictionary output conversion by checking Use Dictionary.

The default value on a new record entry can be specified. The choices are:

· None – No default value will be provided.

· Current date – The default record key will be the current date.

· Current time – The default record key will be the current time.

· Result from stored procedure – A stored procedure name can be specified that generates and returns a default value. The stored procedure should have 4 parameters. The O4W form runner will pass in the name of the form, the current key (if known), and the name of the field, in parameters 1, 2, and 3 respectively. Your stored procedure should return the default value to use in parameter 4.

For example, your stored procedure may have the following definition:

SUBROUTINE MySubroutine(formName, currentKey, fieldname, defValue)

The calculated value should be returned in the defValue parameter.

· Explicit value – In the textbox provided you can specify the default value. When specifying a default value for a field in the form wizard, please note that if a literal value is specified, it should be entered in “internal format”, as the form wizard will apply any specified output conversions on the data before it is displayed. For example, when using a literal default value on a field that has a date conversion, the default value should be specified as an internal date (16488) rather than an external date (02/20/2013).

Below is the property panel for Input/Display Properties for an Input type: Textbox.

Entered values can automatically be converted to UPPECASE or lowercase.

The following input validation types are supported.

If desired, select the field-level events that will call the commuter module for this field. The commuter module can be called before the focus is set to the current field (“Entering field”, or “Pre-field”), when the focus is lost from the current field (“Leaving field”, or “Post-field”), and/or when the value in the current field has been changed (“Changed value”, or “Changed”)

The Input Size is specified in characters.

Below is the property panel for Input/Display Properties for an Input type: Password.

The default values for new records are as follows:

· Result from stored procedure – A stored procedure name can be specified that generates and returns a default value. The stored procedure should have 4 parameters. The O4W form runner will pass in the name of the form, the current key (if known), and the name of the field, in parameters 1, 2, and 3 respectively. Your stored procedure should return the default value to use in parameter 4.

For example, your stored procedure may have the following definition:

SUBROUTINE MyRoutine(formName, currKey, fieldname, defValue)

The calculated value that should be used as the default should be returned in the “defValue” parameter.

Below is the property panel for Input/Display Properties for an Input type: Radio Buttons.

The source of values/codes choices are as follows.

The values/codes can be selected from a table where the keys are the “code”, and a specific field contains the “value” to display; or from a single record that contains both the “codes” and the “values” in separate fields; or from one of the standard defined options; or from a user-defined stored procedure.

If the values and codes are generated by a stored procedure, the stored procedure should have the following format:

SUBROUTINE MySubroutine(ignoredParam, valuesParam, codesParam)

The codes should be passed in the 3rd parameter (codesParam), where each code is separated by a value mark (@VM); the display values should be passed in the 2nd parameter (valuesParam), where each display value is also separated by a value mark (@VM). There should be a 1-to-1 correspondence between each code value and each display value.

If the source is “Table with keys as code”, you can optionally specify a SELECT statement that the form runner will execute to generate the list of codes and values in the desired order. You can use WITH, BY, etc. clauses to organize the list of codes as required. If no SELECT statement is specified, all codes and values in the table will be retrieved and displayed in random order.

Below is the property panel for Input/Display Properties for an Input type: Checkboxes.

Below is the property panel for Input/Display Properties for an Input type: Listbox.

Below is the property panel for Input/Display Properties for an Input type: Combobox.

Below is the property panel for Input/Display Properties for an Input type: Type-ahead Listbox.

Below is the property panel for Input/Display Properties for an Input type: Multiline Text.

Below is the property panel for Input/Display Properties for an Input type: Date picker.

Below is the property panel for Input/Display Properties for an Input type: Color picker.

Below is the property panel for Input/Display Properties for an Input type: Time picker.

Below is the property panel for Input/Display Properties for an Input type: File upload.

The upload destination can be specified if the contents of the upload file should be placed in an OI table or Windows folder. By default, if Upload Destination is left blank, the contents of the uploaded file will be placed directly into the field; if upload destination is specified as two pieces of information separated by a space, it will be interpreted as an OI table and record name; if upload destination is specified as a single string, it will be interpreted as a Windows file. You may use “wild card” characters to build the OI record name or Windows file name – “^” represents the uploaded file’s original file name, “$” represents the uploaded file’s original extension, and “#” represents the current internal date and time (concatenated together). Examples of valid upload destinations would include:

MYTABLE MYID places the uploaded information into the OI table “MYTABLE”, record “MYID”;

MYTABLE #_MYID places the uploaded information into the OI table “MYTABLE”, record <internalDate><internalTime>_MYID (for example, 1594210929_MYID);

C:\uploadedloc\doc#.$ places the uploaded information in the Windows folder c:\uploadedloc\, with the file name “doc<internalDate><internalTime>.<originalExtension>” (for example, doc1594210929.txt)

Below is the property panel for Input/Display Properties for an Input type: Hidden textbox.

You can set the Value Links/Popup Properties for each field by clicking the button.

Below is the property panel for Link Properties:

The Link type properties are as follows:

If O4W Form (Key) is specified, the link value will be used as the key to an O4W form (which you will subsequently specify); if O4W Procedure is specified, the link value will be passed into the subsequently specified O4W procedure as “PARAM1”. If “Explicit URL” is selected, you must enter the exact URL you wish to link to; the link value can be placed in this URL by using the “wildcard” character “^”. If “Value is URL” or “Email link” is selected, then the link value is used as the explicit URL to link to or as the explicit email address. An “Embedded URL” type will embed the specified URL in a “frame” on the current form; this is useful if you wish to embed, for example, a Google Docs document on the current form (note that you can again use the wildcard character “^” to substitute the link value in the embedded URL). The “LinkedIn Profile” and “LinkedIn Share” links will display the appropriate LinkedIn links.

The Display Image properties are as follows:

If “Value is URL” is selected, then the field’s value is taken as the URL to display. If “Explicit Link” is selected, then an explicit URL must be entered. The field’s value will be substituted for the wildcard character “^” in the explicit URL.

The Popup Type properties are as follows:

A popup type of “O4W Report” will allow you to take a previously-defined O4W Report and use it as a popup. A type of “OI Popup” will allow you to specify the name of an existing OI popup, and will automatically convert that OI popup for O4W. A type of “Index Lookup” will prompt for the name of the table to search, and the fields to search and display (comma-delimited):

If the popup type is “Stored Procedure”, you must specify the name of a custom O4W stored procedure to run as a popup.

This custom O4W stored procedure must be created using the O4W APIs, and “registered” as a valid O4W procedure.

If popup type is “Dummy”, no popup will be displayed, but the commuter module associated with the O4W form will be triggered instead.

We will now explore each component on the Completion tab. You can choose to generate or re-build your commuter module shell for this form by checking the box provided. Clicking the Save button will save your form.

If you choose not to re-build your commuter module you can Download Updated Code to notepad so that you can cut & paste any new code generated without destroying your original commuter module.

You can Open or Save the newly generated commuter module code.

Below is a sample of the generated commuter module code for your form:

For styling purposes:

· The ‘collector’ window has a table with class “prompts”

· The main form has tables with class “formbody”

O4W Form Commuter Module

FUNCTION O4WCM_CUSTOMERS(CtlEntId, Event, Request)

 

* Auto-generated by O4W_DEFINE_FORM at 16:35:26  26 FEB 2018

 

* Standard equates

$Insert O4WEquates

$Insert O4WFormEquates

$Insert O4W_COMMUTER_COMMON

 

rtnValue = 1

Begin Case

   Case event _eqc 'CREATE'

      * called when initially creating the form

      * variable 'ctlentid' is a unique identifier for this instance of the form

      * To abort form processing at this point, set rtnValue to 0 (rtnValue=0) and optionally set statMsg@ to desired error text

   Case event _eqc 'READY'

      * called when form initially drawn

   Case event _eqc 'PRE_READ'

      * called before reading record from table

      * variable 'ctlentid' is ID of record (if available)

      * variable '@record' is the record contents (if available)

      * examine variable bIsNew@ to determine if this is being called for displaying the search result (bIsNew@=''),

      * or - when retrieving the record for actual display/editing - if this is a new record (bIsNew@=1), or a record that is supposed to exist (bIsNew@=0)

      * set variable 'rtnValue' to 0 (rtnValue=0)to disable further event processing

      * set variable 'rtnValue' to -1 (rtnValue=-1) to skip READ but continue processing

      *  (If performing the read in this code, and you intend to set the rtnValue=-1, you should:

      *     - fill the @RECORD variable with the desired record contents

      *  )

      * set variable 'statMsg@' to desired error/status text

   Case event _eqc 'READ_CHECK'

      * called before write or delete to verify record has not been changed by another user

      * set variable 'rtnValue' to -1 (rtnValue=-1) to skip READ but continue processing

      *  (If performing the read in this code, and you intend to set the rtnValue=-1, you should fill the @RECORD variable with the desired record contents)

   Case event _eqc 'POST_READ'

      * called after reading record from table

      * variable 'ctlentid' is ID of record (if available)

      * variable '@record' is the record contents (if available)

   Case event _eqc 'PRE_WRITE'

      * called before writing record to table

      * variable 'ctlentid' is ID of record (if available)

      * variable '@record' is the record contents (if available)

      * if any fields failed input convertion, variable 'statMsg@' contains details about the failure

      * set variable 'rtnValue' to 0 (rtnValue=0) to disable further event processing

      * set variable 'rtnValue' to -1 (rtnValue=-1) to skip WRITE but continue processing

      * set variable 'statMsg@' to desired error/status text

   Case event _eqc 'POST_WRITE'

      * called after writing record to table

      * variable 'ctlentid' is ID of record (if available)

      * variable '@record' is the record contents (if available)

      * set variable 'statMsg@' to any desired 'success' message

      * set variable 'redirectTo@' to url to transfer to after success

   Case event _eqc 'PRE_DELETE'

      * called before deleting record from table

      * variable 'ctlentid' is ID of record (if available)

      * variable '@record' is the record contents (if available)

      * if any fields failed input convertion, variable 'statMsg@' contains details about the failure

      * set variable 'rtnValue' to 0 (rtnValue=0) to disable further event processing

      * set variable 'rtnValue' to -1 (rtnValue=-1) to skip DELETE but continue processing

      * set variable 'statMsg@' to desired error/status text

   Case event _eqc 'POST_DELETE'

      * called after deleting record from table

      * variable 'ctlentid' is ID of record (if available)

      * variable '@record' is the record contents (if available)

      * set variable 'statMsg@' to any desired 'success' message

      * set variable 'redirectTo@' to url to transfer to after success

   Case event _eqc 'SELECT'

      * called when building list of records to display in picklist or as result of search

      * variable 'ctlentid' is name of list record (in SYSLISTS table) to be generated

      * set variable 'rtnValue' to 0 (rtnValue=0) to skip selection

      * set variable 'rtnValue' to -1 (rtnValue=-1) if generating list of matching ids in the commuter module

      * (if generating list of matching ids in this code, and you intend to set rtnValue=-1, you should create a list record with the id passed in CtlEntId)

   Case event _eqc 'TAB'

      * called when 'tab' clicked, or back/next button clicked

      * variable 'ctlentid' is number of current tab

      tabname = formDef@<tabnames$, ctlentid>

      * variable userFields@ is number of 'next' tab

      * set variable 'rtnValue' to 0 (rtnValue=0) to abort tab change

      * set variable 'statMsg@' to any desired error/status text

      * to examine all the fields on the current tab:

      num.fields = dcount(formDef@<attr$>, @VM)

      for each.field = 1 to num.fields

         if formDef@<ValueTab$, each.field> = tabname then

            fieldName = formDef@<attr$, each.field>

            thisValue = O4WGetValue('FIELD_':each.field)

         end

      next each.field

   Case event _eqc 'POST_DRAW'

      * called after fields in the form have been populated (after POST_READ)

   Case Event _eqc 'POPUP'

      * called after popup has returned a value

      fieldName = O4WCommuterUtility(CtlEntId, O4WUTILITY_FIELDNAME$)

      * set variable 'rtnValue' to 0 (rtnValue=0) to abort setting popup return value in form

      * set variable 'statMsg@' to any desired error/status text

      * examine/change variable 'userFields@' for the popup value

      * ctlEntId is the field that should get the return value

      Begin Case

         Case fieldName _eqc 'WEBSITE'

      End Case

End Case

 

Return rtnValue

Copy/Delete

From the O4W Form menu choose Copy/Delete.

Select the form name you want to copy. Enter the name of the form you want to create in the textbox provided and click the Copy button. To delete an existing O4W Form, select the form name you want to delete and press the DELETE button.

Run

From the O4W Form menu choose Run.

Select the name of the O4W Form you want to run and press the Run button. Checking Run in another tab will launch the form in the next tab on your browser.

  • o4w/oi10/reference_guide/o4w_form.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1