Submit() Method
You use the proper Submit() method of a Screen object to submit data to MYOB Acumatica. You select the needed Submit() method by using in the name of the method the prefix that contains the ID of the MYOB Acumatica form with which the method works.
Syntax
public Content[] Submit(Command[] commands)
Parameter
- commands: You use this parameter to specify the data that you are
going to submit. In this parameter, you pass to the web service an array of
Command objects in which you can specify commands that do the
following:
- Set the values of elements on the form by using Value commands.
- Click buttons on the form (for example, the Save button) by using Action commands.
- Get the result of data processing by using Field commands.
Return value
The result of processing of the data submitted by using the Submit()
method is returned as a Content object specific to the form to which the
data has been submitted. This object contains the values of the elements that you specified
by using Field commands in the array of Command
objects, which you pass to the Submit() method. The values of the
elements that were not specified by using Field commands are
null
.
If you want only to submit data to an MYOB Acumatica form and do not need to obtain any values of elements after submitting, do not specify any Field commands in the array of the Command object that you pass to a Submit() method. In this case, the Submit() method does not return any value.
Example 1: Submitting Data and Obtaining the Result of Processing
null
.AR303000Content custSchema = context.AR303000GetSchema();
var commands = new Command[]
{
...
custSchema.Actions.Save,
custSchema.CustomerSummary.CustomerName,
custSchema.GeneralInfoFinancialSettings.CustomerClass
};
AR303000Content customer = context.AR303000Submit(commands)[0];
Example 2: Submitting Data without Obtaining the Result of Processing
AR303000Content custSchema = context.AR303000GetSchema();
var commands = new Command[]
{
new Value
{
...
},
custSchema.Actions.Save
};
context.AR303000Submit(commands);