ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE


This content has been translated automatically.  Click here  to view the French version.
  • Calling a global component procedure
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
ExecuteProcess (Function)
In french: ExécuteTraitement
Starts the execution of an event or process programmatically, i.e. without the user having to perform any particular action in the interface. The event/process executed can be:
  • an event of a control (in a window, a page or a report),
  • an event of a menu option,
  • an event of a report block,
  • an event of a window,
  • an event of a page,
  • an event of a report,
  • a process of a procedure.
    Remark: To execute of a procedure in the main thread of the application, use:
Example
// Exécute le traitement de clic sur un champ Bouton
ExecuteProcess(BTN_Sauve, trtClick)
 
// Exécute le traitement de clic sur un champ via indirection
ExecuteProcess({NChamp}..Value, trtClick)
// Exécute une procédure locale (test) appartenant
// à une autre fenêtre/page ouverte (menu)
ExecuteProcess(Menu.Test, trtProcédure)
// Exécute la procédure LitFichier
// en lui passant en paramètre le nom du fichier
ExecuteProcess(LitFichier, trtProcédure, NomFichier)
Syntax

Executing an event associated with a control Hide the details

ExecuteProcess(<Control used> , <Process> [, <Parameter 1> [... [, <Parameter N>]]])
<Control used>: Control name
Name of the control (or menu option) associated with the process (or event) to run.
For an option in a popup menu, use the following notation: <Name of popup menu>.<Option name>.
Caution: If the name of the control is not directly specified (with an indirection, for example), you must explicitly use the Value property.
<Process>: Integer constant
Event to be executed among the WLanguage events available for controls:
trtActionAction code of Web Component control. This code is available in server code and in browser code.
trtAddDiagShapeCode for adding a shape in a Diagram Editor control.
New in version 28
trtAddKanbanCard
Code for adding a card to an control Kanban.
trtAddTokenCode for adding a token into a "Text token" edit control.
trtAddWidgetCode for adding a widget to a Dashboard control.
trtAfterOpeningDocument"After opening document" code of Word Processing control, Image Editor control, Spreadsheet control or PDF Reader control.
trtBeforeClosingDocument"Before closing document" code of Word Processing control, Image Editor control, Spreadsheet control or PDF Reader control.
trtBeforeCreatingOrganizerApt"Before creating the appointment" code of the Organizer control.
trtBeforeCreatingScheduleApt"Before creating the appointment" code of Scheduler control.
trtChange"Whenever modified" code of control.
trtChangeDiagShapeCode for changing a shape in a Diagram Editor control.
trtChangeOrganizerPeriod"Whenever changing period" code of Organizer control.
trtChangePlane"Whenever changing plane" code of a Sliding Banner control.
trtChangePositionMap"Whenever changing position" code of Map control.
trtChangeSchedulePeriod"Whenever changing period" code of Scheduler control.
trtClickClick code of control.
trtClickButtonArrowClick code on the arrow associated with a button.
trtClickHTMLLink"Click on a link" code of an HTML Display control.
trtClickTokenClick code on a token in a "Text token" Edit control.
trtCollapseExpandBranchCollapsed/Expanded code of a node in a TreeView or TreeView Table control.
Caution: This parameter requires a specific syntax. For more details, see the remarks.
trtCollapseExpandBreakCollapsed/Expanded code of a break in a Looper or Table control.
trtCollapseExpandDrawerBrowser code run each time the Drawer control is collapsed or expanded.
trtComboClosingClosing code of drop-down list.
trtComboOpeningCode for opening the drop-down list of Combo Box control.
trtDelayedPlaneLoad"Delayed plane load" code of a plane.
trtDeleteDiagShapeCode for deleting a shape in a Diagram Editor control.
New in version 28
trtDeleteKanbanCard
Code to delete a card in an control Kanban.
trtDeleteOrganizerAptCode for deleting an appointment from an Organizer control.
trtDeleteScheduleAptCode for deleting an appointment from a Scheduler control.
trtDeleteTokenCode for deleting a token from a "Text token" Edit control.
trtDeleteWidgetCode for deleting a widget from a Dashboard control.
trtDoubleClickDouble-click code.
trtEndChange"End of modification" code (Slider and Scrollbar control only).
trtEndInitialization"End of initialization" code (browsing List Box, Table and Combo Box control).
trtEndLoadingHTMLPage"After loading the HTML page" code of an HTML Display control.
New in version 28
trtEndMovingKanbanCard
Code for the end of the movement of a card in an control Kanban.
trtEnterEntry code in the control.
trtEnterInputOrganizerAptEntry code in input for an appointment in an Organizer control.
trtEnterInputSchedulerAptEntry code in input for an appointment in a Scheduler control.
trtExitExit code of control.
trtInitInitialization code of control.
New in version 28
trtKanbanCardDetails
Code for displaying the details of a card in an control Kanban.
trtLineDisplayCode used to display a row (Table control only).
trtLineEnterEntry code of a row (Table control only).
trtLineExitExit code of row (Table control only).
trtLoadingHTMLResource"Load resources" code of an HTML Editor or HTML Display control.
trtMenuOptionCode of menu option (main or context menu).
trtModificationColumnFilterCode "Whenever modifying the filter (user input in header)" of a Table Column control.
trtModificationSpreadsheetCell"Cell modification" code of Spreadsheet control.
trtMoveDiagShapeCode for moving a shape in a Diagram Editor control.
New in version 28
trtMoveKanbanCard
Code for moving a card in an control Kanban.
trtMoveOrganizerAptCode for moving an appointment in an Organizer control.
trtMoveScheduleAptCode for moving an appointment in a Scheduler control.
trtMoveWidget"Moving a widget" code of Dashboard control.
trtOrganizerInputExitAptExit code from input for an appoingment in an Organizer control.
trtPullToRefresh"Pull to refresh" code of a Table or Looper control.
trtReadFirstCode for reading the first record (Table control only).
trtReadLastCode for reading the last record (Table control only)
trtReadNextCode for reading the next record (Table control only).
trtReadPreviousCode for reading the previous record (Table control only).
trtReassignResourceScheduleAptCode for re-assigning an appointment in a Scheduler control.
trtRefreshRibbonCode for refreshing the ribbon of PDF Reader and Word Processing controls.
trtResizeDiagShapeCode for resizing a shape in a Diagram Editor control.
trtResizeOrganizerAptCode for resizing an appointment in an Organizer control.
trtResizeScheduleAptCode for resizing an appointment in a Scheduler control.
trtResizeWidget"Resizing a widget" code of Dashboard control.
trtRightClickRight-click code (for the TreeView control only).
trtRightClickHTMLLink"Right click on a link" code of an HTML Display control.
trtScheduleInputExitAptExit code from input for an appoingment in a Scheduler control.
trtSelectDiagShapeCode for selecting a shape in a Diagram Editor control.
trtSelectionSelection code (Combo Box, List Box and Table control).
trtSelectOrganizerAptCode for selecting an appointment in an Organizer control.
trtSelectOrganizerPeriodCode for selecting a period in an Organizer control.
trtSelectScheduleAptCode for selecting an appointment in a Scheduler control.
trtSelectSchedulePeriodCode for selecting a period in a Scheduler control.
trtSliderChange"Whenever modified" code (Slider control only).
trtSpinMinusDecrement code of Spin control.
trtSpinPlusIncrement code of Spin control.
trtStartLoadingHTMLPage"Before loading the HTML page" code of an HTML Display control.
New in version 28
trtStartMovingKanbanCard
Code to start moving a card in an control Kanban.
trtValueAssignmentCode for assigning the Value property of Web Component control. This code is available in browser code only.
trtValueRetrievalCode for retrieving the Value property of a Web Component control. This code is available in browser code only.
trtZoomModificationCode for modifying the zoom of a Range Slider control.


Control or block of a report: Event to be executed among the available WLanguage events:
trtPostPrint"Post Print" code of a block.
trtPrePrint"Pre Print" code of control or block.
<Parameter 1>: Any optional type
First optional parameter to be passed to the code (for WLanguage events that expect parameters).
<Parameter N>: Any optional type
Nth optional parameter to be passed to the code (for WLanguage events that expect parameters).
Reports and Queries

Executing a WLanguage event associated with a window Hide the details

ExecuteProcess(<Window used> , <Process> [, <Parameter 1> [... [, <Parameter N>]]])
<Window used>: Window name
Name of the window with a WLanguage event to be executed.
<Process>: Integer constant
Event to be executed among the WLanguage events available for windows.
trtBeforeClosingWindow"Allow closing" code.
trtChangeModification code of the window.
trtChangeLayout"Change of layout" code.
trtClickCode of the button associated with the click in the window.
trtClosingClosing code of the window.
trtDoubleClickCode of button associated with the double click in the window.
trtGetFocusCode of focus gain for the window.
trtKillFocusCode of focus loss for the window.
trtOpening or trtInitInitialization code of the window.
trtRequestRefresh"Request for updating the display" code.
trtResizeCode for resizing the window.
trtRightClickCode of button associated with the right click in the window.
trtSystemButton"Before closing with OK/Close button" code.
<Parameter 1>: Any optional type
First optional parameter to be passed to the code (for WLanguage events that expect parameters).
<Parameter N>: Any optional type
Nth optional parameter to be passed to the code (for WLanguage events that expect parameters).
Reports and Queries

Executing a WLanguage event associated with a report Hide the details

ExecuteProcess(<Report used> , <Process> [, <Parameter 1> [... [, <Parameter N>]]])
<Report used>: Report name
Name of the report whose process must be run.
<Process>: Integer constant
event to be executed among the WLanguage events available for reports.
trtClosingClosing code of report.
trtFilterCode for filtering the report data.
trtOpening or trtInitOpening code of report.
trtReadDataCode for reading the report data.
<Parameter 1>: Any optional type
First optional parameter to be passed to the code (for WLanguage events that expect parameters).
<Parameter N>: Any optional type
Nth optional parameter to be passed to the code (for WLanguage events that expect parameters).
Reports and Queries

Executing a WLanguage procedure Hide the details

<Result> = ExecuteProcess(<WLanguage procedure> , <Process> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Any
Return value of procedure called. This value is identical to the value obtained if the procedure is run directly.
<WLanguage procedure>: Procedure name
Name of procedure to execute.
<Process>: Integer constant
Procedure to run. This procedure corresponds to:
  • one of the following constants:
    trtProcedureRun the specified procedure according to the execution context (procedure of the window, procedure of the WINDEV/WEBDEV component or procedure of the project).
    trtProjectProcedureRuns the specified procedure. This procedure is a procedure of the project that is hosting the WINDEV/WEBDEV component.
    This parameter can only be used for a WINDEV/WEBDEV component included in another project.
  • a variable of type Procedure Description (usable only to execute a class method). For more details, see Enumerating and handling the objects of a class.
<Parameter 1>: Any optional type
First optional parameter that will be passed to the procedure.
<Parameter N>: Any optional type
Nth optional parameter that will be passed to the procedure.
Remarks
Reports and Queries

Calling a global component procedure

ExecuteProcess is used to call a global component procedure. To do so, use the following syntax:
ExécuteTraitement(<Composant>.<Collection de procédures>.<Procédure>, ...
trtProcédure)
Example:
ExecuteProcess("MonComposant.Collection_WDExemple.MaProcédure", trtProcédure)
In a thread started by a component, ExecuteProcess cannot be used to call a local procedure of a window from the host project.
You must use a global procedure of the host project to call the local procedure of the window.
Business / UI classification: Neutral code
Component: wd280vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Dynamically Execute Class Methods using ExecuteProcess()
Hi

In order to dynamically call class methods use the following syntax.
ClassInst is ClassObject
MethodToCall is string = "ClassMethod"
ReturnVal is string (e.g. if the method returns a string value)

ReturnVal = ExecuteProcess(ClassInst,MethodToCall,Param1,Param2, ...)

PeHoBe
28 Oct. 2021