Fnd_Out
27 shared methods.
- Fnd_Out_Active
- Fnd_Out_AddField
- Fnd_Out_AddLayout
- Fnd_Out_AddSearchField
- Fnd_Out_AllowCustomColumns
- Fnd_Out_ConfigureList
- Fnd_Out_Default
- Fnd_Out_EditRecord
- Fnd_Out_EditSelection
- Fnd_Out_fieldName
- Fnd_Out_fieldType
- Fnd_Out_FormMethod
- Fnd_Out_getPrimaryKey
- Fnd_Out_HideField
- Fnd_Out_Info
- Fnd_Out_ListBoxMethod
- Fnd_Out_MaxRelationDepth
- Fnd_Out_OfferField
- Fnd_Out_OfferFormula
- Fnd_Out_ORDARelatedField
- Fnd_Out_SearchClear
- Fnd_Out_SearchDate
- Fnd_Out_SearchHelp
- Fnd_Out_SearchHint
- Fnd_Out_SearchRun
- Fnd_Out_SynchroniseSelection
- Fnd_Out_Update
Fnd_Out_Active
Fnd_Out_Active ({activate?}) --> Boolean
Pass True to activate this component for the current process, or False to deactivate for the current process. May also be called as a function to determine the current state.
| Parameter | Type | Direction | Description |
|---|---|---|---|
active | Boolean | in | Activate? (optional) |
Result | Boolean | out | Active |
Fnd_Out_AddField
Fnd_Out_AddField (->field | formula | columnObject {; width{; header{; alignment{; format{; visible}}}}})
Allows the developer to specify the columns to display in the output list. Call multiple times to display multiple columns.
The first parameter decides how the column is described, and the method reads its type to tell which of three forms you have used. All three are current and none is deprecated.
1. A field pointer. The simplest form, and the original one. The column header defaults to the field's virtual-structure name.
2. A formula as text. Use this to display a calculation, or a field reached through relations, which a pointer cannot express. The header defaults to the name derived from the formula.
3. An object. Use this when a column needs more than the five trailing parameters can carry — minimum and maximum widths, font style, an explicit field type. Only fo_field is compulsory; every other property has a default, listed below.
Form 1, by pointer:
Fnd_Out_AddField(->[Invoice]Date; 80; "Invoice date")
Form 2, by formula, for a calculation or a field reached through relations:
Fnd_Out_AddField("Invoice.Customer.Name"; 120)
Form 3, by object, when the column needs more than the parameters carry:
$column_o:=New object("fo_field"; "Invoice.Total"; "fo_minWidth"; 60; \
"fo_maxWidth"; 200; "fo_hAlign"; Align right; "fo_style"; Bold)
Fnd_Out_AddField($column_o)
Forms 1 and 2 take the column's settings from the trailing parameters. Form 3 takes them from the object instead — that is the point of it — so pass the object alone.
Object properties, with the default applied when the property is absent:
fo_field Text COMPULSORY. Field name, or a formula reaching one through relations. A
"Formula: " column returning a picture is detected as Is picture; fo_type can force it
fo_title Text Column header. Defaults to the name derived from fo_field
fo_type Longint Field type. Defaults to the type deduced from fo_field
fo_format Text Display format. Defaults to none. For a date, time or picture column it is
the format constant, e.g. "fo_format"; Scaled to fit prop centered (a picture
defaults to Scaled to fit proportional)
fo_hAlign Longint Align default | Align left | Align right | Align center. Defaults to Align default
fo_vAlign Longint Align top | Align center | Align bottom, for this column's cells. Defaults to
the list's (Fnd_Out_Default with Fnd_Out_VAlign), which itself defaults to Align center
fo_width Longint Column width. Defaults to 0, meaning the default width
fo_minWidth Longint Minimum width. Defaults to 10
fo_maxWidth Longint Maximum width. Defaults to 0, meaning no maximum
fo_style Longint Font style. Defaults to Plain
fo_visible Boolean Whether the column shows. Defaults to True (the auto-inserted
primary-key column 0 is always invisible regardless of this property)
In forms 1 and 2 the format parameter takes String(<constant>) for a date, time or picture.
Widths, in any form: 0 uses the default size, and a negative number auto-sizes the column with that number as its minimum.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inField | Variant | in | A field pointer, a formula as text, or a column object |
inWidth | Longint | in | The width for the column (optional, forms 1 and 2) |
inHeader | Text | in | The column header (optional, forms 1 and 2) |
inAlignment | Longint | in | The column alignment (optional, forms 1 and 2) |
inFormat | Text | in | The column display format (optional, forms 1 and 2) |
inVisible | Boolean | in | Visible column (optional, forms 1 and 2) |
Fnd_Out_AddLayout
Fnd_Out_AddLayout ($inName_t : Text; $inVisible_c : Collection {; $inTextSize_i : Integer {; $inRowHeight_i : Integer}})
Developer configuration hook: declares a built-in layout for the current table, offered in the palette's Layout popup ahead of any user or shared layout. Calling this again with the same name replaces the earlier declaration rather than adding a second one.
This only declares the layout in memory (Fnd.out.devConfig) - it is not written to Resources/Fnd_Out/<Table>.json. A developer running interpreted can also capture the palette's current widths/order into a built-in layout with Fnd_Out_LayoutSaveBuiltIn, which does write the file.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inName | Text | in | The layout's name |
inVisible | Collection | in | fo_field values that should be visible |
inTextSize | Integer | in | Text size the layout sets (optional) |
inRowHeight | Integer | in | Row height (in lines) the layout sets (optional) |
Fnd_Out_AddSearchField
Fnd_Out_AddSearchField (->field | path | searchObject {; operator {; title}})
Declares one field the output list's search box looks in. Call it once for each field, from Fnd_Hook_Out_SearchFields. A table with no declared fields gets no search box.
The first parameter is one of:
1. A field pointer: ->[Contacts]LastName 2. A text attribute path, for a field reached through relations: "contact.LastName"
3. An object, for the tech-savvy: fo_field is the path, fo_operator the operator and fo_title the title. Each outranks the matching parameter.
The title is the field's name in the search box's grey hint and its help tip. It defaults to the field's virtual field name, as Fnd_VS_SetFieldTitle gives it; a path with no virtual field name shows its last segment. An operator of "" means begins.
Fnd_Out_AddSearchField(->[Contacts]LastName)
Fnd_Out_AddSearchField(->[Contacts]Company; "contains")
Fnd_Out_AddSearchField("contact.LastName")
Fnd_Out_AddSearchField(New object(fo_field; "contact.LastName"; fo_operator; "keyword"))
Fnd_Out_AddSearchField(->[Invoices]InvoiceNumber; ""; "Inv. #")
Fnd_Out_AddSearchField("contact.LastName"; "contains"; "Customer")
Fnd_Out_AddSearchField(New object(fo_field; "contact.LastName"; fo_title; "Customer"))
Operators, for a text field. A number field is searched only when the search text is a number, and a date field only when it is a date; other types are ignored.
begins The text starts with the search text. The default.
contains The search text appears anywhere in the text.
keyword The search text is a whole word in the text (4D's % operator).
exact The text is the search text, with @ taken literally.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inField | Variant | in | A field pointer, a text attribute path, or a search object |
inOperator | Text | in | begins, contains, keyword or exact (optional; default begins) |
inTitle | Text | in | The name shown in the hint and help tip (optional; default the virtual field name) |
Fnd_Out_AllowCustomColumns
Fnd_Out_AllowCustomColumns ({$allow_b : Boolean}) --> $allowed_b : Boolean
Developer configuration: may the user add, edit and delete custom columns (formulas) in the current list? Call with a value from Fnd_Hook_IO_DisplayTable to set it for this list; call with nothing to read what applies, which is the application default (Fnd_Out_Default with Fnd_Out_AllowCustomColumns), the table's allowCustomColumns and this list's value, all of which must allow it. Formulas already added stay listed, under Custom Columns, whatever the answer.
| Parameter | Type | Direction | Description |
|---|---|---|---|
allow | Boolean | in | False to forbid custom columns in this list (optional) |
Result | Boolean | out | Whether custom columns are allowed in this list |
Fnd_Out_ConfigureList
Fnd_Out_ConfigureList (font{; size{; row height}})
Retired: use Fnd_Out_Default, or the "appearance" of Resources/Fnd_Out/<Table>.json. Still honoured: writes the current table's in-memory appearance.
| Parameter | Type | Direction | Description |
|---|---|---|---|
font | Text | in | Font Name |
inSize | Longint | in | Font Size |
inRowHeight | Longint | in | Row height, in lines (matching lk lines, the row height |
Fnd_Out_Default
Fnd_Out_Default ($tag_t : Text {; $value_v : Variant}) --> $result_v : Variant
Developer configuration: the programmed default appearance of every list. One parameter reads the stored value (Null when none was set); two store it, last call wins, and return it. Call from the host's startup or from Fnd_Hook_IO_DisplayTable. A list opens from the form's own values, then these, then the table's Resources/Fnd_Out/<Table>.json "appearance", then the user's saved default and the list's own saved definition. The View Options Reset button returns to the first three.
Use the constants rather than the strings: Fnd_Out_FontName ("fontName") : Text : font of the columns Fnd_Out_TextSize ("textSize") : Integer : text size of the columns Fnd_Out_RowHeight ("rowHeight") : Integer : row height in lines Fnd_Out_RowPixels ("rowPixels") : Integer : row height in pixels, outranks lines Fnd_Out_VAlign ("vAlign") : Integer : vertical alignment of the cells: Align top, Align center (the default) or Align bottom. A column's own fo_vAlign outranks it Fnd_Out_Fill ("fill") : Integer : background colour, as OBJECT SET RGB COLORS takes it Fnd_Out_AltFill ("altFill") : Integer : alternate background colour Fnd_Out_RelationDepth ("maxRelationDepth") : Integer : relations deep the palette offers Fnd_Out_MaxColumns ("maxColumns") : Integer : columns of the best-guess layout Fnd_Out_AllowCustomColumns ("allowCustom") : Boolean : may users add custom columns (formulas); Null, meaning True, until set Fnd_Out_AllowPublish ("allowPublish") : Boolean : may users publish and delete shared layouts; Null, meaning the Designer, the Administrator and the Administration group, until set
An unknown tag, or a value of the wrong type, raises a bug alert, stores nothing and returns Null.
| Parameter | Type | Direction | Description |
|---|---|---|---|
tag | Text | in | One of the tags above |
value | Variant | in | The value to store (optional) |
Result | Variant | out | The stored value, Null when unset or refused |
Fnd_Out_EditRecord
Fnd_Out_EditRecord ($row_i)
Opens the record in the given row of the output list for editing, in the list's own window, as a double-click does.
| Parameter | Type | Direction | Description |
|---|---|---|---|
row | Integer | in | The row to edit, 1 to the number of rows in the list |
Fnd_Out_EditSelection
Fnd_Out_EditSelection ($selected_es)
Opens each record of the entity selection for editing, one after another, in a new process of its own. Does nothing when the selection is Null or empty.
| Parameter | Type | Direction | Description |
|---|---|---|---|
selected | Object | in | The entity selection whose records are to be edited |
Fnd_Out_fieldName
Fnd_Out_fieldName (Formula) --> Text
Pass a formula to determine the header to include in the display listbox
Fnd_Out_fieldTitle("invoice.client.FirstName") --> FirstName
| Parameter | Type | Direction | Description |
|---|---|---|---|
theFormula | Text | in | A formula |
Result | Text | out | The name of the field |
Fnd_Out_fieldType
Fnd_Out_fieldType (Formula or field pointer) --> Long
Pass either the field pointer or a formula to determine the field type to include in the display listbox Fnd_Out_fieldType(->[Client]ID) --> 9 (Is longint) Fnd_Out_fieldType("invoice.client.FirstName") --> 0 (Is alpha field) A "Formula: " path gives Is text, or Is picture when the formula returns one
| Parameter | Type | Direction | Description |
|---|---|---|---|
theFormula | Variant | in | A field pointer or a valid formula |
Result | Long | out | Field Type (-1 indicates error) |
Fnd_Out_FormMethod
Fnd_Out_FormMethod
The controlling from method for the Fnd_Out form
No parameters.
Fnd_Out_getPrimaryKey
Fnd_Out_getPrimaryKey (Table Number)--> Integer
Returns the primary key field for a table
| Parameter | Type | Direction | Description |
|---|---|---|---|
tableNumber | Long | in | Table Number |
Result | Long | out | Field Number |
Fnd_Out_HideField
Fnd_Out_HideField ($inPath_t : Text)
Developer configuration hook: marks a field path (own-table or one level through a relation, e.g. "contact.Notes") so the View Options palette never offers it as a candidate column. Wildcards ("@") are honoured, e.g. "@.Password" hides that field on every relation. A column the host's own AddField already defines is unaffected - offer rules never touch a column that's already on the list.
Call from wherever the host configures Fnd_Out for a table (alongside Fnd_Out_AddField calls). Mutates the in-memory developer configuration only - it is not written to Resources/Fnd_Out/<Table>.json until a developer explicitly saves a built-in layout or uses the palette's developer-mode "offer" toggle.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inPath | Text | in | A field path, or a wildcard pattern using "@" |
Fnd_Out_Info
Fnd_Out_Info (label) --> Text
Returns requested information. See the Fnd_Gen_ComponentInfo method for more information.
Responds to: • version - what version. • name - the name of the module. • state - Is Fnd_Out active for THIS process? (active/inactive) • highlighted - the number of records highlighted in the listbox. • inSelection - the number of records displayed in the listbox. • inTable - the number of records in the table.
Numeric codes: -1 : Fnd_Out is not active in this process -2 : Called oustde the context of the Fnd_Out form -3 : Called in the Fnd_Out form, but object not yet initialised/touched (most likely On Load Form Event).
| Parameter | Type | Direction | Description |
|---|---|---|---|
request | Text | in | Info desired |
Result | Text | out | Response (convert to string for numbers) |
Fnd_Out_ListBoxMethod
Fnd_Out_ListBoxMethod
Controller for listbox
No parameters.
Fnd_Out_MaxRelationDepth
Fnd_Out_MaxRelationDepth ($inDepth_i : Integer)
Developer configuration hook: sets how many relations deep the View Options palette looks for candidate columns on the current table. 1 offers "invoice.Total" but not "invoice.contact.LastName"; 0 offers the table's own fields only. The default, when this is never called, is 5.
Call from wherever the host configures Fnd_Out for a table (alongside Fnd_Out_AddField calls). Mutates the in-memory developer configuration only, exactly as Fnd_Out_HideField does.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inDepth | Integer | in | The most relations a candidate's path may cross |
Fnd_Out_OfferField
Fnd_Out_OfferField ($inPath_t : Text)
Developer configuration hook: the companion to Fnd_Out_HideField. The first call for a table switches the palette from "offer everything except what's hidden" to "offer only what's explicitly listed" - every path (or wildcard pattern) passed to Fnd_Out_OfferField for that table becomes the only-list a candidate must match to be offered. A column the host's own AddField already defines is unaffected either way.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inPath | Text | in | A field path, or a wildcard pattern using "@" |
Fnd_Out_OfferFormula
Fnd_Out_OfferFormula ($inFormula_t : Text; $inTitle_t : Text; $inType_i : Integer)
Developer configuration hook: declares a formula the View Options palette should offer under the table's "Other Columns" block, even though it isn't a plain attribute path. The formula is normalised (trimmed) before it's compared or stored, exactly as Fnd_Out_AddField normalises a "Formula: " fo_field, so the two never drift into near-duplicate text. A formula the host has already added as a real column through Fnd_Out_AddField is not duplicated - Fnd_Out_CandidateColumns skips a declared formula that matches an already-defined column.
Calling this twice for the same formula (after trimming) is a no-op - the second call is silently ignored rather than adding a duplicate entry.
| Parameter | Type | Direction | Description |
|---|---|---|---|
inFormula | Text | in | The formula expression, e.g. "This.fullName()" |
inTitle | Text | in | The column header offered for it |
inType | Integer | in | The 4D field type the formula returns |
Fnd_Out_ORDARelatedField
Fnd_Out_ORDARelatedField --> ReturnType
Returns a pointer
| Parameter | Type | Direction | Description |
|---|---|---|---|
in | Object | in | Parameter block |
in | Text | in | name of dataclass from which the relation starts |
in | Text | in | Path to bound attribute |
Result | Pointer | out | Pointer to attribute field |
Fnd_Out_SearchClear
Fnd_Out_SearchClear ({run search})
Empties the search box. Called by the box's clear button, which also shows every record, and by Fnd_Gen_SelectionChanged through EXECUTE METHOD IN SUBFORM, which passes False because the list has already been replaced.
Runs in the Fnd_Out_Search subform.
| Parameter | Type | Direction | Description |
|---|---|---|---|
runSearch | Boolean | in | Show every record and focus the box (optional, default True) |
Fnd_Out_SearchDate
Fnd_Out_SearchDate (searchText) --> Date
Reads the text typed in a list's search box as a date. These are understood: a full date in the system's short format or ISO form; the localised words for today and yesterday; a bare number, which is that day of the current month; and a day and month typed in the system's order, such as 4/11 or 11/4, which is that day of the current year.
| Parameter | Type | Direction | Description |
|---|---|---|---|
searchText | Text | in | The text typed by the user |
Result | Date | out | The date, or the blank date !00-00-00! when the text is not one |
Fnd_Out_SearchHelp
Fnd_Out_SearchHelp ({maximum length}) --> Text
The names of the fields the list's search box looks in, joined by commas: all of them for its help tip, or, given a maximum length, as many as fit followed by an ellipsis, for its placeholder. A single name is never shortened.
A host can call it from Fnd_Hook_Out_SearchFields, after the Fnd_Out_AddSearchField lines, to include the list in a tooltip it gives to Fnd_Out_SearchHint.
| Parameter | Type | Direction | Description |
|---|---|---|---|
maxLength | Integer | in | The longest text wanted (optional; default every name) |
Result | Text | out | The searched fields' names |
Fnd_Out_SearchHint
Fnd_Out_SearchHint (hint {; tooltip})
Replaces the text of the output list's search box. Call it from Fnd_Hook_Out_SearchFields, for the table being opened.
The hint is the grey text in the empty box. It is shown as written, never shortened. The tooltip is the help tip on the box and its icon; it may be long and may contain carriage returns. An empty hint or tooltip keeps Foundation's own text: for the hint, the field names that fit; for the tooltip, every field name.
Fnd_Out_SearchHelp returns that list of field names, so a tooltip can include it, provided it is called after the Fnd_Out_AddSearchField lines.
Fnd_Out_SearchHint("Invoice no. or customer"; "Invoice numbers match from the start."+Char(Carriage return)+"Searches: "+Fnd_Out_SearchHelp)
| Parameter | Type | Direction | Description |
|---|---|---|---|
hint | Text | in | The grey text in the empty search box |
tooltip | Text | in | The help tip (optional; default every searched field's name) |
Fnd_Out_SearchRun
Fnd_Out_SearchRun (searchText)
Searches the whole table of the output list for the text and displays the result; empty text shows every record. Runs in the context of the list's own form, so the search box calls it through CALL FORM. Does nothing when the text is the same as in the previous search.
Fnd_Hook_Out_Search, if the host has it, is tried first; when it returns Null the fields declared by Fnd_Hook_Out_SearchFields are searched.
| Parameter | Type | Direction | Description |
|---|---|---|---|
searchText | Text | in | The text typed in the search box |
Fnd_Out_SynchroniseSelection
Fnd_Out_SynchroniseSelection
Updates the current record selection to match the displayed entity selection.
No parameters.
Fnd_Out_Update
Fnd_Out_Update
No parameters.