Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

MES Stateless API

Data Types

For any method, all parameters are required for scripting. If you pass Null for any of the parameters, they are ignored. Such parameters are called Nullable and are set to Nothing (or Null in System Platform object scripts). You can also pass database Null (DB Null) for the parameters. Database Null is not ignored, but sets the database field value to Null. For Database Null, you need to use the DB Data Type and you can pass either Null (ignored) or DB Null (field set to Null).

The following example shows two parameters of the the Job.UpdateSpecific() method:

Sample Script CS

Dim rework As Nullable(Of Boolean)
Dim spare1 As DBString

The following example uses the same declaration and calls the UpdateSpecific()method:

System Platform

DimreworkAsBoolean;

Dimspare1AsaaMES.aaDBString;

'Variable set here

aaResult= aaMES.Prod.aaJob.UpdateSpecific(sessionId,woId,operId,seqNo,jobDesc,itemId,stateCd,jobPriority,reqFinishTimeLocal,initSchedEntId,targetSchedEntId,runEntId,qtyReqd,qtyProd,qtyProdErp,qtyRejected,qtyRejectedErp,qtyAtStart,deviationAbove,deviationBelow,batchSize,schedPinned,checkInv,estFixedLab,estLabRate,estSetupTime,estTeardownTime,estProdRate,prodUom,estTransferTime,schedStartTimeLocal,latestStartTimeLocal,schedFinishTimeLocal,actStartTimeLocal,actFinishTimeLocal,concurrentLink,jobCost,parentContingentJob,childContingentJob,notes,assocFile,assocFileType,statusNotes,displaySeq,folderVerId,rework,reworkCd,reworkProcessId,spare1,spare2,spare3,spare4,lastEditComment,editTime);

Visual Basic .Net

Dim rework As Boolean

Dimspare1AsaaMES.aaDBString

'Variable set here

aaResult = aaMES.Prod.aaJob.UpdateSpecific(sessionId, woId, operId, seqNo, jobDesc, itemId, stateCd, jobPriority, reqFinishTimeLocal, initSchedEntId, targetSchedEntId, runEntId, qtyReqd, qtyProd, qtyProdErp, qtyRejected, qtyRejectedErp, qtyAtStart, deviationAbove, deviationBelow, batchSize, schedPinned, checkInv, estFixedLab, estLabRate, estSetupTime, estTeardownTime, estProdRate, prodUom, estTransferTime, schedStartTimeLocal, latestStartTimeLocal, schedFinishTimeLocal, actStartTimeLocal, actFinishTimeLocal, concurrentLink, jobCost, parentContingentJob, childContingentJob, notes, assocFile, assocFileType, statusNotes, displaySeq, folderVerId, rework, reworkCd, reworkProcessId, spare1, spare2, spare3, spare4, lastEditComment, editTime)

The following 3 cases show how to set the value, ignore the parameter, and pass DB Null to it:

Case

System Platform

Visual Basic .Net

Set the Value

rework=False;

spare1 = New aaMES.aaDBString("Your text");

rework = False

spare1 = New aaMES.aaDBString("Your text")
Ignore the Parameter

rework=Null;

spare1 = Null;

rework = Nothing

spare1 = Nothing
Sent to DB Null

'Not possible for rework

spare1 = aaMES.aaDBString.Null;

'Not possible for rework

spare1 = aaMES.aaDBString.Null

 This help document describes the following data types: 

Types

Members

Description

Standard Data Types

Boolean
Integer
Double
Date
String

These are straight forward and defined as shown in the example below.
The exception is the Date data type, which is defined as System.Datetime. For example: 

System Platform

DimforFirstOpAsBoolean;

Dim releaseTime As System.DateTime;
Visual Basic .Net

DimforFirstOpAsBoolean

Dim releaseTime As System.DateTime

Nullable Nullable(Of xxxx)
Where xxx is one of the standard data types like Boolean

Nullable data types are used for optional values. If you pass Null for these parameters, they will be ignored.
The nullable data types are declared using the base data types. However, if you want to pass Null, then use Null in the call. For example:

System Platform aaResult = aaMES.Core.aaSession.GetSessions(Null , clientType, Null );
Visual Basic .Net

DimoNullAs Object=Nothing

aaResult = aaMES.Core.aaSession.GetSessions(oNull, clientType, oNull)

or

aaResult = aaMES.Core.aaSession.GetSessions(Nothing,clientType, Nothing)

They are used for optional arguments where you do not want to pass an argument.  For example, the UpdateSpecific() method has many arguments; however, for fields that you do not want to update, pass Null. The Null values are ignored.

For output parameters such as LastEditAt, you must pass a valid value or use the following:

Dim lastEditAt As Object;

lastEditAt = NULL;

 

DB Data Types DBInt
DBDouble
DBDateTime
DBString

These data types are similar to the Nullable types except that, you can use them to set the value to Database Null. For example, for an UpdateSpecific()method, spare1 is defined as follows:

Dimspare1AsDBString

To clear this field, you can use the following:

System Platform

Dim spare1 As aaMES.aaDBString;

spare1 = aaMES.aaDBString.Null;
Visual Basic .Net

Dim spare1 As aaMES.aaDBString

spare1 = aaMES.aaDBString.Null

To leave the spare1 field unchanged, you must pass Nullas described in the Nullable data types.

When setting these values, it is recommended to use the constructor as follows:

DBInt = aaMES.aaDBStringaaMES.aaDBInt(0)
DBDouble = aaMES.aaDBDouble(0)
DBDateTime = aaMES.aaDBDateTime (Now())
DBString = New aaMES.aaDBString("mystring")

The following is an example of setting a DBString

System Platform

Dim spare1 As aaMES.aaDBString;

spare1 = New aaMES.aaDBString("mystring");
Visual Basic .Net

Dim spare1 As aaMES.aaDBString

spare1 =NewaaMES.aaDBString("mystring")

Others Class specific

There are some custom data types that must be used. Generally, these are used in association with data enumerations. For example, the Session.StartSession() method defines the clientType parameter as follows:

Dim clientType As ClientTypes

You can define it as:

Dim clientType As aaMES.Core.aaClientTypes

You can then define it as:

System Platform

Dim clientType As aaMES.Core.aaClientTypes;

ClientType = aaMES.Core.aaClientTypes.clientOperator;

Visual Basic .Net

Dim clientType As aaMES.Core.aaClientTypes

clientType = aaMES.Core.aaClientTypes.clientOperator

The following table defines the data types and how to use them within the scripts:

DataType

System Platform Object and Graphics

Visual Basic .Net

Standard Data Types
As Boolean

AsBoolean;

AsBoolean

As Integer

AsInteger;

AsInteger

As Double

AsDouble;

AsDouble

As Date

AsSystem.DateTime;

AsSystem.DateTime

As String

AsString;

AsString

Nullable Data Types
As Nullable(Of Boolean)

AsBoolean;

AsBoolean

As Nullable(Of Integer)

AsInteger;

AsInteger

As Nullable(Of Double)

AsDouble;

AsDouble

As Nullable(Of Date)

AsSystem.DateTime;

AsSystem.DateTime

As Nullable(Of String)

AsString;

AsString

DB Data Types
As DBInt

AsaaMES.aaDBInt;

As aaMES.aaDBInt

As DBDouble

AsaaMES.aaDBDouble;

As aaMES.aaDBDouble

As DBDateTime

AsaaMES.aaDBDateTime;

As aaMES.aaDBDateTime

As DBString

As aaMES.aaDBString;

As aaMES.aaDBString

Others
As DataSet

AsSystem.Data.DataSet;

As System.Data.DataSet

TitleResults for “How to create a CRG?”Also Available in