Using the API call from System Platform
- Last UpdatedNov 06, 2025
- 2 minute read
The Stateless API can be used from System Platform scripts for Objects or inside Graphics (or Symbols). The key difference is that the System Platform Objects run on the server, whereas Graphics run on the client. For this reason, they connect differently to the Middleware. The data (or UDAs) on the System Platform Objects is shared by many users. For System Platform Graphics, the scripts are used to handle user requests. This makes it easier to manage. The System Platform Graphics also have some limitations on the data types.
When using MES API scripts, there can be significant time delay between making the call and receiving a response from the MES Database. It is recommended to place the MES API calls within an asynchronous script so that they do not impact the System Platform engine, which executes the script.
It is recommended to avoid using the On Scan script to execute MES API calls, because all the required supporting systems may not be completely initialized if you run an On Scan script after rebooting the computer.
When creating Application Object scripts that run asynchronously, you cannot count on the execution order. When an asynchronous script is executed, it is fired and the engine goes to the next script without waiting for the asynchronous script to complete. The asynchronous script maybe completed in this scan or in the next scan. So, it is recommended to create long object scripts that perform a complete task; otherwise it may take several scans to complete the transaction.
Differences between Application Object scripts and Graphics (or Symbols) scripts:
- In Graphics, you cannot use Null in the function calls. Instead, you must use the following:
Dim oNull As Object;
aaResult = aaMES.Core.aaSession.GetSessions(oNull , clientType, oNull );
- In Graphics, you use Custom Properties instead of UDAs. Custom Properties are not reference with me. (only the custom property name is required).
- Graphics require the exact declaration for variables used in the calls. For example, with the Application Object script that uses the StartSession()method, you can define the clientType as an Integer. For Graphics, you need to define it correctly as ClientTypes. The following is an example:
| System Platform Object Scripts |
Dim clientType As Integer; |
| ArchestA Graphic Scripts |
Dim clientType As aaMES.Core.aaClientTypes; |
Note: In VB .Net scripts, use .ToString if the dataset values may be null, whereas, this is not required in System Platform. For the UpdateSpecific()methods, you can use either an ID or a DateTime field to refer to the record that is updated. For some calls such as the Job.UpdateSpecific(), you must pass the editTime, though it is an optional argument. Generally, you must call a Get() method to get this key and use it in the UpdateSpecific()method.