API Objects Related to MYOB Acumatica Forms
The main object, which provides access to all other objects and methods of the MYOB Acumatica web services API, is a Screen object. By using the methods of a Screen object, you can log in to MYOB Acumatica and retrieve, insert, update, and delete data. You can also use the methods to perform any actions that are exposed by MYOB Acumatica forms available through the web service.
Screen Object
After you have logged in to MYOB Acumatica by using the web services API, you can access data on MYOB Acumatica forms available through the web service. The Screen class provides the same set of API methods for working with all MYOB Acumatica forms available through the service. You can find out which form a method accesses by noting the prefix in the name of the method, which is the form ID. For example, the Export() method that you use to export data from the Stock Items (IN202500) form is IN202500Export().
Content Object
Screen context = new Screen();
...
IN202500Content stockItemsSchema = context.IN202500GetSchema();
Command Object
By using subobjects of a Content object, you configure the sequence of commands that should be executed during data import, data export, or data processing through the web service. You configure the sequence of commands inside an array of objects of the Command type. When you are reflecting the selection of an element on a form in the sequence of commands, you have to select the object of the MYOB Acumatica form whose element you want to access. The objects that are available inside a Content object have names that are similar to the names of the UI elements that you see on the form and have the ID of the form as a prefix.
For example, to be able to select the Item Class element, which is located in the Item Defaults group on the General tab of the Stock Items form (shown in the following screenshot), you would select the GeneralSettingsItemDefaults property of the IN202500Content object. This property provides access to the IN202500GeneralSettingsItemDefaults object, which includes the ItemClass property.
//stockItemsSchema is a IN202500Content object
var commands = new Command[]
{
stockItemsSchema.StockItemSummary.ServiceCommands.EveryInventoryID,
stockItemsSchema.StockItemSummary.InventoryID,
stockItemsSchema.StockItemSummary.Description,
stockItemsSchema.GeneralSettingsItemDefaults.ItemClass,
stockItemsSchema.GeneralSettingsUnitOfMeasureBaseUnit.BaseUnit
};
For more information on the commands, see Working with Commands of the Screen-Based SOAP API.
Actions Object
To insert an action to a sequence of commands, such as clicking a button, you use the corresponding property of the special API object Actions (which has a prefix with the ID of the form in the name). The Actions object is available through the Actions property of the Content object that corresponds to the form. The properties of the Actions object have names that are similar to the names of corresponding buttons on the form, such as Delete.
You can view the classes available through the web services API by using Object Browser in Visual Studio.