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

MES Stateless API

Logging on to Entities

After you log on to a session, you can create one or more entities. With the stateless API, logging on to an entity is not a requirement to make a call against an entity. The main reason for logging on to an entity is to track labor usage.

Dim Result as aaMES.Result;
dim DS as System.Data.DataSet;
me.cmdLogonEntity = false;
If me.SessionID > 0 then
'aaMES.Core.aaSession.LogOnEnt( sessionId, userId, entName, siteName, curLabCd, pctLabToApply, curLabDeptId, logOnTime );
Result = aaMES.Core.aaSession.LogOnEnt( me.sessionId, me.MES.userId, me.entityName, "", null, null, null, null );
If Result.Success then
if me.debug then
LogMessage("successfully logged on to entity: " + me.EntityName);
endif;
'aaMES.Core.aaEnt.GetEntityId( entName, site );
Result = aaMES.Core.aaEnt.GetEntityId( me.entityName, "" );
DS = Result.DataSet_value;
me.EntityID = DS.Tables(0).Rows(0).Item("ent_id");
me.ResultText = "successfully logged on to entity: " + me.EntityName;
else
me.ResultText = "Failed to log on to entity: " + me.EntityName + ". " + result.Exception.Message;
endif;
else
me.ResultText = "No Session for Logon Entity";
endif;

 

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