ExecutePageScriptA
Forms, JavaScript safety
Description
The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to ExecutePageScript and string arguments are interpreted using the current SetAnsiMode code page
Runs a page's open or close JavaScript action
Syntax
Delphi
Function DLExecutePageScriptA(InstanceID, Page: Integer; Trigger: PAnsiChar): Integer;
DLL
int DLExecutePageScriptA(int InstanceID, int Page, const char* Trigger);
Parameters
| Page | The one-based page number |
|---|---|
| Trigger | O page open or C page close |
Return values
Returns 1 when the script ran, or 0 when the action is absent (diagnostics report notRun with reason missingAction), the trigger or target is invalid (LastErrorCode 708, or a missing form or field), or the script is unsupported, invalid or over budget (706, 708, 709)
Remarks
event.type is Page and event.name is Open or Close; the selected page is unchanged afterwards
The script runs in the bounded form-script runtime with the configured limits and host action mode. event.type and event.name identify the event, and event.rc is not used. Field values the script assigns, such as getField("Total").value = ..., are written to the document
Host actions such as app.alert are never performed; see SetFormScriptHostActionMode
See also
ExecuteFormFieldScriptEvent, SetFormScriptHostActionMode, GetFormScriptDiagnostics