skip to main content
OpenEdge Development: ADM Reference
Field Objects and Their Methods and Properties : Methods for lookup field objects
 
Methods for lookup field objects
This section lists and describes the methods for SmartLookup field objects. A SmartLookup is a faster but less general version of a SmartSelect object.
anyKey
Procedure used to trap a keypress and display a single-value return by going directly to the query.
Location: lookup.p
Parameters: None
Note: Use LAST-EVENT:FUNCTION for testing keypress.
createLabel
Creates the label for the Lookup.
Location: lookup.p
Parameters:  
INPUT pcLabel AS CHARACTER
The label string.
Returns: HANDLE
Note: This function is separated in order to create the label in design-mode. The label is defined in the parent Frame.
destroyLookup
Destroys associated lookups, labels, and buttons.
Location: lookup.p
Parameters: None
Returns: LOGICAL
Notes: None
destroyObject
Local override of destroyObject, this procedure deletes created widgets.
Location: lookup.p
Parameters: None
Notes: None
disableButton
Procedure that disables the specific Lookup’s button and Browser to prevent the use of the Lookup.
Location: lookup.p
Parameters: None
Note: Use this procedure when you want to modify a specific record, but do not want a user to use a specific Lookup to find another record and potentially modify the record.
disableField
Procedure that disables Lookup field in a Viewer.
Location: lookup.p
Parameters: None
Note: The SmartDataViewer calls this procedure if a widget of type PROCEDURE is encountered in disableFields.
disable_UI
Procedure that disables the user interface and releases memory, typically at the end of a session.
Location: lookup.p
Parameters: None
Note: This procedure cleans up the user interface by deleting dynamic widgets that were created and hiding Frames.
displayLookup
Procedure that finds and displays a Lookup. This routine is published by the SmartViewer to populate the Lookup with the evaluated query data, if the query was successful. The queries were initially built in getLookupQuery.
Location: lookup.p
Parameters:  
INPUT TABLE FOR ttLookup
Notes:  
*This allows all lookup queries to be built at the cost of a single AppServer call.
*Note that this is not run at all in ADD mode, unless the Lookup is manually fired.
enableButton
If you disable the Lookup button to prevent the user from using it, this procedure calls this routine to re-enable the button again.
Location: lookup.p
Parameters: None
Notes: None
enableField
This procedure, enables a Lookup Field. The SmartDataViewer calls this routine if a widget of type PROCEDURE is encountered in enableFields.
Location: lookup.p
Parameters: None
Notes: None
endMove
In design mode, this procedure moves the label when the field is moved.
Location: lookup.p
Parameters: None
Note: Defined as PERSISTENT on END-MOVE of the frame of the widget.
enterLookup
This procedure fires a trigger on entry of lookup field.
Location: lookup.p
Parameters: None
Note: This trigger stores the current screen value of the displayed field in the Lookup. When the displayed and key fields are not the same, and the displayed field is changed in the leave trigger, code can be run to check whether the value entered actually exists as a unique record. If it does, the Lookup need not be used.
hideObject
This procedure gets the value of LabelHandle, hides the label, and then calls RUN SUPER.
Location: lookup.p
Parameters: None
Note: For sizing reasons, the label is not really a part of the object, but added as a text widget to the parent frame.
initializeBrowse
This procedure initializes the lookup browser window.
Location: lookup.p
Parameters: None
Notes: None
initializeLookup
This procedure runs as part of initializeObject to set up the lookup.
Location: lookup.p
Parameters: None
Note: Defaults keyfield to actual field if not defined. Defaults displayed field to keyfield if not defined. Assumes a data type of decimal for keyfield and character for displayed field if different.
insertExpression
PRIVATE function. Inserts an expression into one buffer’s WHERE clause.
Location: lookup.p
Parameters:  
INPUT pcWhere AS CHARACTER
A complete WHERE clause with or without the FOR keyword, and without leading or trailing commas.
INPUT pcExpression AS CHARACTER
New expression/OF phrase to replace the existing OF phrase.
INPUT pcAndOr AS CHARACTER
Whether to AND (default) or OR the new expression.
Returns: CHARACTER PRIVATE
Notes:  
*The new expression is embedded in parentheses, but no parentheses are placed around the existing expression.
*Lock keywords must be unabbreviated or without –LOCK (that is, SHARE or EXCLUSIVE.)
*Any keyword in comments might cause problems.
leaveLookup
This procedure is fired on leave of a lookup field and handles the situation when a value is manually entered rather than using the lookup key.
When this occurs, it must be determined whether the screen value has changed. If the screen value has changed, it must be verified whether the changed screen value is a valid record. If it is a valid record, the key value is reset to avoid using the lookup.
Location: lookup.p
Parameters: None
Notes: None
newQueryString
Returns a new query string to the passed query. The tables in the passed query must match getQueryTables(). Adds column/value pairs to the corresponding buffer’s WHERE clause. Each buffer’s expression is always enclosed in parentheses.
Location: lookup.p
Parameters:  
INPUT pcColumns AS CHARACTER
Comma-separated list of column names, of the form table.fieldname.
INPUT pcValues AS CHARACTER
Comma-separated list of the corresponding values.
INPUT pcDataTypes AS CHARACTER
Comma-separated list of the corresponding data type.
INPUT pcOperators AS CHARACTER
Comma-separated list of operators. If a single operator, applies to all columns. If blank, defaults to EQ. Separate alternative string operators with a slash; example: EQ/BEGINS.
INPUT pcQueryString AS CHARACTER
A complete, fully-qualified query string matching the queries tables. If the Unknown value (?), use the base query.
INPUT pcAndOr AS CHARACTER
How to relate the new expression to the existing query (for each buffer). Valid values are AND and OR.
Returns: CHARACTER
Note: This was taken from query.p but changed for lookups to work without an SDO.
newWhereClause
Appends a new expression to the query’s prepare string for a specified buffer.
Location: lookup.p
Parameters:  
INPUT pcBuffer AS CHARACTER
The target buffer.
INPUT pcExpression AS CHARACTER
The new expression.
INPUT pcWhere AS CHARACTER
The current query-prepare string.
INPUT pcAndOr AS CHARACTER
The operator with which to append the new expression: ‘AND’ (default) or ‘OR’.
Returns: CHARACTER
Note: This is a utility function that does not use properties.
resizeObject
This procedure resizes the Lookup by deleting the widget, resizing the Frame, and recreating the widget.
Location: lookup.p
Parameters:  
INPUT pidHeight AS DECIMAL
The new height.
INPUT pidWidth AS DECIMAL
The new width.
Notes: None
returnParentFieldValues
Value of returnParentFieldValues.
Location: lookup.p
Parameters:  
OUTPUT pcNewQuery AS CHARACTER
Notes: None
rowSelected
This procedure publishes a lookup complete event in the container allowing developers to perform some action when a row is selected from the browser.
Location: lookup.p
Parameters:  
INPUT pcAllFields AS CHARACTER
Comma-separated list of found fieldnames.
INPUT pcValues AS CHARACTER
Chr(1)-separated list of corresponding field values.
INPUT pcRowIdent AS CHARACTER
Comma-separated list of ROWIDs of query buffers (ROWIDENT.)
Note: This will not fire if the field is changed manually in the fill-in, so you will need to use lookupleave as well to trap for this.
translateBrowseColumns
This procedure translates lookup and filter browse columns.
Location: lookup.p
Parameters:  
INPUT pcObjectName AS CHARACTER
INPUT phBrowseHandle AS HANDLE
Notes: None
valueChanged
This procedure sets DataModified to YES to ensure that the SmartDataViewer container is notified that the value has changed for Lookup.
Location: lookup.p
Parameters: None
Note: Defined as a PERSISTENT value-changed trigger in the dynamic-widget. The code currently duplicates the logic defined in the U10 trigger in the SmartDataViewer because checking FOCUS is not helpful when the change is caused by a user event in the Browser.
viewObjec
This procedure makes sure the label is not HIDDEN.
Location: lookup.p
Parameters: None
Note: For sizing reasons, the label is not really a part of the object, but added as a text widget to the parent frame.
whereClauseBuffer
Returns the buffer name of a WHERE clause expression. This function avoids problems with leading/double blanks in WHERE clauses.
Location: lookup.p
Parameters:  
INPUT pcWhere AS CHARACTER
The complete WHERE clause, with or without the FOR keyword, for a single table. The buffer name must be the second token (third if FOR is present) in the clause. For example: "EACH order OF customer", "FOR EACH order".
Returns: CHARACTER PRIVATE
Note: PRIVATE, used internally in query.p only.