This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
Standard actions

Standard actions  


 

Standard actions can be used in several ways:

Form objects or menu commands can be assigned both a standard action and a method. In this case, the standard action is always executed after the method (except for the deleteRecord action, see below). 

Some standard actions accept one parameter that will define their execution. The syntax to use is similar to the URL syntax:

 standardActionName{?nameParameter=valueParameter}

where:

  • standardActionName is the name of the standard action (string).
  • nameParameter (optional) is the name of the parameter to pass (string)
  • valueParameter (optional) is the value to set (string, longint...)

For example, to define a goto page(5) action, you can write:

 gotoPage?value=5

This syntax is available wherever a standard action can be defined, i.e. in the Property list, Menu editor, or in the language commands. For example, in the Property list:

This section describes standard actions, available in 4D forms, that allow you to handle form pages and records.

Action nameConstant (if any)Activation conditionsAvailable with(*)Description
"" (empty string)ak noneN/AButtons, Menu commandsDoes not perform a standard action. Use this value when you need to write a method to manage the control. For example, a button that displays a custom Find dialog box in a custom application would not have a standard action because you must write a method to open the custom dialog box.
acceptak acceptNone (can be handled by the OBJECT SET ENABLED command)(**)Buttons, Menu commandsSaves a new or modified record, thus triggers either On Saving New Record Event or On Saving Existing Record Event. It also accepts a form displayed with the DIALOG command. In all cases, it triggers the On Validate form event.
cancelak cancelNone (can be handled by the OBJECT SET ENABLED command)(**)Buttons, Menu commandsExits the current record without saving any changes. It can also close a form displayed with the DIALOG command, or exit a form displaying a selection of records using DISPLAY SELECTION or MODIFY SELECTION.
deleteRecordak delete recordA record is selected and is not a new record being addedButtons, Menu commandsDisplays an alert asking the user to confirm the deletion. Clicking Yes in the alert deletes the current record. After the user clicks a Delete Record button, 4D automatically returns to the output display. Particular case: If a method is also assigned to the button/menu, the standard action is called first and the method is executed only if the user clicked Yes in the alert dialog box.  
nextRecordak next recordA record is selected and is not the last of the selectionButtons, Menu commandsAccepts the current record and then makes the next record the current one.
previousRecordak previous recordA record is selected and is not the first of the selectionButtons, Menu commandsAccepts the current record and then makes the previous record the current one.
firstRecordak first recordA record is selected and is not the first of the selectionButtons, Menu commandsAccepts the current record and then makes the first record the current one.
lastRecordak last recordA record is selected and is not the last of the selectionButtons, Menu commandsAccepts the current record and then makes the last record the current one.
nextPageak next pageMulti-page form and you are not on the last pageButtons, Menu commandsDisplays the next page.
previousPageak previous pageMulti-page form and you are not on the first pageButtons, Menu commandsDisplays the previous page.
firstPageak next pageMulti-page form and you are not on the first pageButtons, Menu commandsDisplays the first page.
lastPageak last pageMulti-page form and you are not on the last pageButtons, Menu commandsDisplays the last page.
editSubrecordak edit subrecord
  • List box: at least one row of a "selection" type list box is selected.
  • Subform: has focus and a record is selected inside.
  • List form: a record is selected in the list.
  • Buttons, Menu commands
  • List box: the record corresponding to the list box row appears in the detail form defined for the list box. The user can modify the values, then validate or cancel the form in order to return to the list box (see also Using standard actions).
  • Subform: the selected subrecord switches to editing mode, either directly in the list, or in the associated detail form (depending on the properties of the subform).
  • List form: the selected record switches to editing mode. With lists displayed via the MODIFY SELECTION / DISPLAY SELECTION commands, the modification is carried out in the list or on the detail page depending on the value of the enterList parameter. In the records display window, the modification is carried out on the detail page (the action is equivalent to a double-click).
  • displaySubrecordak display subrecord
  • List box: at least one row of a "selection" type list box is selected.
  • Subform: has focus and a record is selected inside.
  • List form: a record is selected in the list.
  • Buttons, Menu commands
  • List box: the record corresponding to the list box row appears in the detail form defined for the list box, in read-only mode. The user can only cancel the form in order to return to the list box (see also Using standard actions).
  • Subform: the selected subrecord is displayed in the associated detail form in read-only mode (if defined in the properties of the subform).
  • List form: with lists displayed via the MODIFY SELECTION / DISPLAY SELECTION commands, the selected record is displayed in read-only mode in the detail page depending on the value of the enterList parameter. In the records display window, the selected record is displayed in read-only mode in the detail page.
  • deleteSubrecordak delete subrecord
  • List box: at least one row of a "selection" type list box is selected.
  • Subform: has focus and a record is selected inside.
  • List form: a record is selected in the list.
  • Buttons, Menu commands
  • List box: a confirmation dialog box appears so that the user can confirm or cancel the deletion (see also Using standard actions).
  • Subform: a dialog box appears, which can be used to confirm or cancel the deletion of the selected subrecord(s).
  • List form: a dialog box appears, which can be used to confirm or cancel the deletion of the selected record(s).
  • addSubrecordak add subrecord
  • List box: there is at least one "selection" type list box in the form and its has the focus
  • Subform: has focus
  • List form: none
  • Buttons, Menu commands
  • List box: a new blank record appears in the detail form defined for the list box. The user can enter values, then validate the record and a new blank record automatically appears. This continues until the user clicks on a cancel button (see also Using standard actions).
  • Subform: 4D creates a new record in the table or related table, either directly in the list, or in the associated detail form (depending on the properties of the subform).
  • List form: a new blank record is created. With lists displayed using the MODIFY SELECTION / DISPLAY SELECTION commands, the record is added in the list or in the detail page depending on the value of the enterList parameter. In the records display window, the record is added to the list.
  • automaticSplitterak automatic splitterNone (can be handled by the OBJECT SET ENABLED command)Invisible ButtonsThis standard action allows you to create custom splitters on a form. It can only be assigned to an invisible button (see Buttons). When an invisible button is assigned this action, it behaves in the same way as a splitter. By pasting, for example, a picture in the invisible button, you can create any type of custom interface for your splitters. For more information about splitters, refer to Splitters.
    gotoPageak goto pageMulti-page formTab Controls, List Boxes, Button Grids, Pop-up Menus/Drop-down ListsDisplays the form page (if it exists) that corresponds to the number of the selected item (tab control, list box row, button in grid, pop up menu item). See also Goto Page action.
    gotoPage?value=<page>ak goto pageMulti-page formButtons, Menu commandsDisplays the form page that corresponds to the <page> number

    (*) See Notes about objects and actions below.
    (**) When using the Dynamic pop up menu command, an item associated with this action will not be automatically hidden depending on the context.

    The following standard actions are available only with Web areas.

    Action nameConstant (if any)Activation conditionsAvailable with(*)Description
    openBackURLak open back urlA previous URL was loadedButtons, Menu commandsOpens the previous URL in the browsing sequence carried out by the user in the Web area. Disabled if there is no previous URL; in other words, if the user has only displayed a single page in the Web area.
    openForwardURLak open forward urlopenBackURL previously executedButtons, Menu commandsOpens the next URL in the browsing sequence carried out by the user in the Web area. Disabled if there is no next URL; in other words, if the user has never gone back a page in the sequence.
    refreshCurrentURLak refresh current urlopenBackURL previously executed (can be handled by the OBJECT SET ENABLED command)Buttons, Menu commandsReloads the current contents of the Web area.
    stopLoadingURLak stop loading urlURL being loadedButtons, Menu commandsStops loading the page and/or objects of the current URL in the Web area.

    (*) See Notes about objects and actions below.

    This section describes standard actions that call 4D dialog boxes or quit the 4D application.

    Action nameConstant (if any)Activation conditionsAvailable with(*)Description
    databaseSettingsak database settingsNone (can be handled by the OBJECT SET ENABLED command)(**)Buttons, Menu commandsDisplays(***) the standard Database Settings dialog box.
    quitak quitNone (can be handled by the OBJECT SET ENABLED command)(**)Buttons, Menu commandsDisplays(***) an "Are you sure?" confirmation dialog box, then exits the 4D application if validation occurs. Otherwise, the operation is cancelled. When this action is assigned to a button with which an object method is also associated, the following sequence is executed: first, the confirmation dialog box appears. If it is validated, 4D executes the object method. After its execution, the application quits.
    designModeak return to design modeApplication mode (can be handled by the OBJECT SET ENABLED command)(**)Buttons, Menu commandsBrings the windows and menu bars of the 4D Design environment to the foreground. When the database is running in interpreted mode, this displays the current window of the Design environment. When the database is running in compiled mode, this displays the records window of the current table (in compiled mode, only access to records is possible).
    mscak mscNone (can be handled by the OBJECT SET ENABLED command)(**)Buttons, Menu commandsDisplays the Maintenance and security center window.

    (*) See Notes about objects and actions below.
    (**) When using the Dynamic pop up menu command, an item associated with this action will not be automatically hidden depending on the context.
    (***) Under macOS, the menu commands associated with the databaseSettings and quit actions are automatically placed in the application system menu, when the database is running in this environment. This mechanism simplifies the management of the Quit command under macOS.

    This section describes standard editing actions. These actions can be used with:

    • standard editable areas,
    • multi-styled text areas
    • 4D Write Pro areas.
    Action nameConstant (if any)Activation conditionsAvailable with(*)Description
    undoak undoAn editing action was doneButtons, Menu commandsCancels the last action performed (=Undo command of the Edit menu). Undo should not be confused with Cancel (= cancels any modifications made to a record during its viewing and returns to the Output form)..
    redoak redoAn undo action was doneButtons, Menu commandsRepeats the last action cancelled (= Redo command of the Edit menu).
    cutak cutContents selectedButtons, Menu commandsRemoves the selection and places it in the Clipboard.
    copyak copyContents selectedButtons, Menu commandsPlaces a copy of the selection in the Clipboard.
    pasteak pasteClipboard not emptyButtons, Menu commandsInserts the contents of the Clipboard at the location of the insertion point.
    clearak clearFocused object has an editable areaButtons, Menu commandsDeletes the selection. If nothing is selected, it erases the entire area containing the cursor (enterable areas only).
    selectAllak select allFocused object has an editable areaButtons, Menu commandsSelects all of the selectable elements in the context.
    showClipboardak show clipboardAlways availableButtons, Menu commandsOpens a new window that displays the current contents of the Clipboard.

    Note: Activation conditions always require that the editable area has the focus (except showClipboard).

    (*) See Notes about objects and actions below.

    The following standard actions are available for:

    • multi-style text areas (also named rich text areas)
    • 4D Write Pro areas.

    Note: Additional actions are available for 4D Write Pro areas only. They are documented in the Using 4D Write Pro standard actions section of the 4D Write Pro Reference manual.

    Font  

    Action nameConstant (if any)Activation conditionsAvailable with(*)Description
    backgroundColorak background colorNoneMenu commands, Pop-up/Drop-down lists, Hierarchical Pop-up menusDisplays the standard background color submenu
    backgroundColor?value=<color>ak background colorNoneButtons, Menu commands, List itemsSets the background color to <color>. Pass a Css color value or name. Ex: backgroundColor?value=#FF0000, backgroundColor?value=red, backgroundColor?value=transparent 
    backgroundColor/showDialogak background color dialogNoneButtons, Menu commandsOpens font background color dialog
    colorak font colorNoneMenu commands, Pop-up/Drop-down lists, Hierarchical Pop-up menusDisplays the standard font color submenu
    color?value=<color>ak font colorNoneButtons, Menu commands, List itemsSets the font color to <color>. Pass a Css color value or name. Ex: color?value=#FF0000, color?value=red
    color/showDialogak font color dialogNoneButtons, Menu commandsDisplays the system font color dialog box.
    font/showDialogak font show dialogNoneButtons, Menu commandsDisplays the system font picker dialog box.
    fontItalicak font italicNoneButtons, Menu commandsToggles italic font attribute.
    fontBoldak font boldNoneButtons, Menu commandsToggles bold font attribute.
    fontLinethroughak font linethroughNoneButtons, Menu commandsToggles linethrough font attribute.
    fontSizeak font sizeNoneMenu commands, Pop-up/Drop-down lists, Hierarchical Pop-up menusDisplays the standard font size submenu
    fontSize?value=<size>ak font sizeNoneButtons, Menu commands, List itemsSets the font size to <size>. Pass a Css length value in pt. Ex: fontSize?value=12pt
    fontUnderlineak font underlineNoneButtons, Menu commandsToggles underline font attribute.
    fontStyleak font styleNoneMenu commands, Pop-up/Drop-down lists, Hierarchical Pop-up menusDisplays the standard font style submenu.

    (*) See Notes about objects and actions below.

    Note: When a style attribute is modified via a standard action, 4D generates the On After Edit form event.

    Action nameConstant (if any)Activation conditionsAvailable with(*)Description
    computeExpressionsak compute expressionsNoneButtons, Menu commandsUpdates all dynamic expressions in the area.
    freezeExpressionsak freeze expressionsNoneButtons, Menu commandsFreezes all dynamic expressions in the area.
    visibleReferencesak show referenceNoneButtons, Menu commandsDisplays all dynamic expressions as references.

    (*) See Notes about objects and actions below.

    Spellchecking actions are available only if the Auto Spellcheck option is selected for the area.

    Action nameConstant (if any)Activation conditionsAvailable with(*)Description
    spell/autoCorrectionEnabled-Spellchecking is enabledButtons, Menu commandsEnables/disables automatic correction mode.
    spell/autoDashSubstitutionsEnabled-Spellchecking is enabledButtons, Menu commandsEnables/disables replacement of double hyphens (--) with em dashes (—) during input (macOS only).
    spell/autoLanguageEnabled-Spellchecking is enabledButtons, Menu commandsEnables/disables identification of dictionary language to be used based on text contents (macOS only).
    spell/autoQuoteSubstitutionsEnabled-Spellchecking is enabledButtons, Menu commandsEnables/disables replacement of straight quotes with smart quotes (macOS only).
    spell/autoSubstitutionsEnabled-Spellchecking is enabledButtons, Menu commandsEnables/disables text substitution.
    spell/enabled-NoneButtons, Menu commandsEnables/disables spellchecking in the area (the Auto Spellcheck option must be checked for the area).
    spell/forgetIgnore-Spellchecking is enabledButtons, Menu commandsClears the list of ignored words.
    spell/grammarEnabled-Spellchecking is enabledButtons, Menu commandsEnables/disables grammar checking of text (macOS only).
    spell/ignore-Spellchecking is enabled/An unknown word is selected or has the cursorButtons, Menu commandsUnknown word is left untouched and is no longer underlined.
    spell/learn-Spellchecking is enabled/An unknown word is selected or has the cursorButtons, Menu commandsUnknown word is added to the dictionary.
    spell/removeSubstitution-Spellchecking is enabled/A word that was substituted is selected or has the cursorButtons, Menu commandsRemoves selected substitution.
    spell/showDialog-Spellchecking is enabledButtons, Menu commandsDisplays a spellchecking dialog.
    spell/suggestion?index=<1<=number<=10>-Spellchecking is enabled/misspelled word selectedButtons, Menu commandsnumber is Nth spell suggestion for current first misspelled word in selection. Ex: spell/suggestion?index=1 will replace current misspelled word in current focused view with first suggestion
    spell/unLearn-Spellchecking is enabled/A learned word is selected or has the cursorButtons, Menu commandsRemoves the selected learned word from the list of learned words.
    spell/visibleSubstitutions-Spellchecking is enabledButtons, Menu commandsEnables/disables blue underline for possible substitutions in the text.
    spell-NoneMenu commandsDisplays the full spellchecking menu.

    (*) See Notes about objects and actions below.

    • Buttons means standard Buttons, 3D Buttons, Highlight Buttons, Picture Buttons, and Invisible Buttons. It also includes Check boxes and 3D Check boxes, that can represent actions with true/false status, e.g. "fontBold" (three-state option is supported with Check boxes only). 
    • Pop-Up/Drop-down lists and Hierarchical pop up menu objects can only be associated directly with standard actions that generate a submenu (list), such as "backgroundColor" or "fontSize". In this case, they display an automatic list of values, unless custom standard actions have been set to list items (see below).
    • List items: If you do not want to use automatic values, you can associate custom standard actions with items of a list (using the List editor or the SET LIST ITEM PARAMETER command) and set the list as "Choice list" for the Pop-Up/Drop-down lists and hierarchical pop up menu. Automatic values are replaced by custom actions at runtime. In this context, only standard actions with value parameters in relation with a submenu (list) main action can be used. For example, you can define a list of items associated with backgroundColor action values (backgroundColor?value="red", backgroundColor?value="blue"...) and set it as Choice list for a hierarchical pop up menu.



    See also 

    Download HDI database
    Using standard actions

     
    PROPERTIES 

    Product: 4D
    Theme: Properties for active objects

     
    PAGE CONTENTS 
     
    HISTORY 

    Modified: 4D v16 R3
    Modified: 4D v16 R4

     
    ARTICLE USAGE

    4D Design Reference ( 4D v20 R7)