Public Method

A Public Method may be called from any other Procedure, by the Default plug-in, or a Custom COM DLL. Each Public Method may either use specific Input Parameters, or it may accept an Input Query.

In large systems, Public Methods or Includes should be used whenever possible, such that Message Handlers, the Frontend Procedures, and Backend Procedures of Table Actions, Table Reports, Record Actions, and Record Reports are all able to call the Public Method when needed: if the same source code was instead placed directly inside another Procedure Type, it would not be accessible from other locations.

Parameters and Input Queries

In order to accept an Input Query, the Parameters list should be specified as a *. This should be done for all Public Methods that are intended to be called by the Frontend of the Default Plug-in. To accept Specific Input Parameters, list each of the Parameter names, separated by commas.

Calling a Public Method

In order to call a Public Method elsewhere in MOX, the full dotted Database path name of the Table plus a dot-ProcName should be used: eg MemTab.Person.MyProc.

If specific Input Parameters are used, they should then be listed following the same rules as any other statement/command in MOX. If an Input Query is used, a single Parameter should then specify the name of a Query that exists in the current Procedure, or, if the current Work Query is to be used, do not specify any parameters.

The Call command allows the name of the Public Method being called to be dynamic by making the name of the public method the first parameter of the Call command.

The Thread command works the same as the Call command, but starts the Public Method in a new thread. When used for threads, the Public Method may only use specific Input Parameters; Input Queries are now supported.

Frontend Calls from the Default Plug-in

The Default Plug-in calls Public Methods in the Content database tables to facilitate dynamic website content. For example, when the Default Plug-in is creating the Home page, which is stored in a record with the Alias of Home in the Content.Category Table, it attempts to run the Procedure named Home in the Content.Category Table. The Search feature of the Default Plug-in can be customized by creating a Public Method in the Content.Category Table named Search.

Input Query Object

When a Public Method is initiated with Specific Parameters, the passed Parameters will be in a Query Object named Input and it will be set as the Top Query. Any changes made to this Query will be discarded.

When initiated with an Input Query, that Query will be named Input within the scope of the called Public Method and will be set as the Top Query. Any changes made to this Query will affect the original.

When called by the Frontend of the Default Plug-in, an Input Query is used. The Query will contain the complete record of the user who is logged into the current Session. In this situation, any changes made to the Input Query will be discarded by the Default Plug-in.

Output Query Object

A second Query Object named Output, initially blank, will be set as the Work Query and this becomes the result/return of the Method.

For Frontend calls from the Default Plug-in, this data is discarded; as only the output placed onto the page with one of the Html Output commands will be displayed to the user.

Request Query Object

A third Query Object named Request will in most cases be created and populated with the HTTP(S) request data. Any changes made to this data will be discarded. The complete list of Request Query contents can be found under the headings of Builtin Values, Request Query on the Syntax and Buildin Values page.