This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
INVOKE ACTION
|
INVOKE ACTION ( action {; target} ) | ||||||||
Parameter | Type | Description | ||||||
action | String |
![]() |
Standard action name or pattern including parameter if required | |||||
target | Longint |
![]() |
Defines where to execute the action: current form (default) or main form | |||||
The INVOKE ACTION command triggers the standard action defined by the action parameter, optionally in the target context.
In action, pass the standard action to execute. It can be a string or a constant from the Standard Action theme. Some actions accept a target element and parameters. In this case, you must use the requested pattern, for example "gotoPage?value=2" or paragraph/backgroundPositionV?value=top.
Available 4D actions are listed in the Standard actions section of the 4D Design Reference manual.
Note: Additional specific actions are also provided for 4D Write Pro documents. They are detailed in the Using 4D Write Pro standard actions section of the 4D Write Pro Reference manual.
In target, you can pass the form context where the action must be executed. You can use one of the following constants from the Standard Action theme:
Constant | Type | Value | Comment |
ak current form | Longint | 1 | The current form is the form where the action was called. It could be either the main form or a palette form in front of the main form of the current process. |
ak main form | Longint | 2 | The main form is the frontmost document or dialog form of the process, excluding any floating or pop-up window. |
Note: If target is omitted, by default the ak current form context is used.
Depending on the target, the INVOKE ACTION command execution is either synchronous or asynchronous:
Note: Standard edit actions (Cut, Copy, Paste, Select all, Clear, Undo/Redo) ignore the target parameter, if passed. Such actions are always executed synchronously in the context of the editable object that has the focus.
The INVOKE ACTION command does not generate an error, for example, if the requested action is not available in the current context. You must validate the expected action using the Get action info command.
You want to execute the Copy standard action in the current form:
INVOKE ACTION(ak copy;ak current form)
You want to execute a Goto page standard action (page 3) in the main form:
INVOKE ACTION(ak goto page+"?value=3";ak main form)
Product: 4D
Theme: Language
Number:
1439
Created: 4D v16 R3
4D Language Reference ( 4D v20 R7)