Some content on this site is available only to logged-in subscribers. Contact Us for information on becoming a subscriber.

InSource.Solutions | InSource Training | InSource Client Portal
InSource Solutions Logo
Log In Sign Up
InSource.Solutions InSource Training InSource Client Portal Log In Sign Up
  • Home
  • AVEVA MES & Model Driven MES
  • AVEVA MES Tech Notes

TN MES108 Example API Call to Add Inventory in Wonderware MES

Last updated: March 11th, 2025

Description

  • Author: Brian Schneider
  • Published: March 11th, 2025

Details:

Description

This article from InSource Provides example script using Stateless API call to add inventory in Wonderware MES. 

  • Author: Michael Walker
  • Published: 09/25/2015
  • Applies to: Wonderware MES 2014

Details

Below is an example script calling the aaStorageExec.AddInv method in the stateless API.  Note that the Me.<Attributes>  relative references need to be configured within the Application Server object for this example to function properly. 

dim Result as aaMES.Result;
dim rowID as integer;
dim DT as aaMES.aaDBDateTime;

dim lotNo as aaMES.aaDBString;
dim testlotNo as String;
testLotNo=me.lotNo;
lotNo= new aaMES.aaDBString(testlotNo);
Result= aaMES.EnProd.aaStorageExec.AddInv(me.sessionId,me.entityName,"",me.itemId,"GoodGrade","GoodState",me.GoodQty,lotNo,Null,Null,Null,DT,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,rowId);
If Result.Success then
    me.ResultText="successfully Added Inventory to entity: "+me.EntityName+". And received RowID: "+rowID;
else
    me.resultText="Add Inventory Failed: "+result.Exception.Message;
endif;

 

mes inventory add api
Give feedback about this article

Recommended articles

How to receive group emails

Read More
Support Icon

CONTACT SUPPORT

How to reach us

10800 Midlothian Turnpike Tpke, Suite 209, Richmond, VA 23235

1.877.INSOURCE

Technical Support - 1.888.691.3858

Contact Us

  • InSource Solutions
  • InSource Training
  • InSource Client Portal
  • Log In
InSource Solutions Logo

© 2025 InSource Solutions. All Rights Reserved.

Knowledge Base Software powered by Helpjuice

Expand