Equinox Online Help - Language Reference - A to Z
Pick, PickRecord |
|
---|---|
Applies to | |
Syntax | Pick (ReturnfieldName ,[SearchExpression], IndexName) PickRecord(ReturnfieldName ,[SearchExpression], IndexName, Field1Name [, Field2Name, Field3Name, Field4Name]) |
Action | [Function] These functions compile a list of remote records that pass a search criterion. You pick one of the records and a specified field value is returned from it. |
Scope | Usable anywhere. |
Notes | The PickRecord function is included primarily for compatibility with previous versions of Equinox. The Pick function provides access to more fields via the PickFields statement. It is similar to Lookup, in that it reads a field value from a remote table. It has the advantage that you can choose the required record from a list. Equinox automatically locates the remote table and searches through it using the index specified by IndexName. A list of all records with an index value starting at SearchExpression is generated. SearchExpression may be a MakeKey value. If SearchExpression is omitted, all of the remote records are included in the list. The PickRecord statement selects Field1Name and Field2Name, Field3Name and Field4Name if supplied as the fields to display. The Pick statement uses the fields specified in a previous PickFields statement. The list is presented in a list box on a dialog. For each record, the dialog displays the fields specified. You select a record from the dialog and the value held in ReturnfieldName is returned from it. The following statements control the look and feel of the list box: PopupTitle, PopupSize, PopupFont, PopupColour, PopupColor, PopupFlags and PopupJustification. The field column captions may be set by the PickCaptions statement and the column widths by the PickColumnWidths statement. All of these statements are reset to default after every Pick and PickRecord. Also the PickFields list is cleared. Apart from returning the field value this function also sets the SysReply system workarea:
Note that:
|
Category | Pick lists |
See Also | PickCaptions, PickColumnWidths, PickFields, PickList, PickListSelection, PickRange_PickRecordRange, PickSelection, PickWrite_PickRecordWrite |
Example | The following method determines if the current record is involved in a relational dictionary link. If it is not, the user is prompted to select a record in the related table. The two tables are called Item and Partlist and they are linked on the fields ItemPtno and Ptno (respectively). Hence, when a valid part number is entered into an Item record, an automatic link is created to the corresponding Partlist record. If there is no related record, then the Pick function prompts the user to select a Partlist record. A link is created to the selected record. if IsField(ptno) = false thenPopupTitle "Choose a part Number"end if The following is an example of multiple records being selected from a Pick list and the selections being displayed in a print window. string szName, s |