Commands for Pop-Up Dialog Boxes and Pop-Up Forms
Pop-Up Dialog Boxes
When you update specific fields on some forms under certain circumstances, the system displays pop-up dialog boxes where you need to respond to a question (by clicking a button) in order to proceed. For example, when you update the Customer Class value on the Customers (AR303000) form for an existing customer, the system displays a Warning dialog box with the text Please confirm if you want to update current customer settings with the customer class defaults. Otherwise, original settings will be preserved. and the Yes and No buttons. You should click Yes to proceed with changing the customer class.
- In the Value property, specify the answer that you select in the dialog box during manual entry of a record.
- In the LinkedCommand property, use a DialogAnswer service command, which is available through the ServiceCommands subobject of an object that invokes the appearance of the pop-up dialog box.
//custSchema is an AR303000Content object
var commands = new Command[]
{
...
new Value
{
Value = "Yes",
LinkedCommand = custSchema.CustomerSummary.ServiceCommands.DialogAnswer
},
new Value
{
Value = "INTL",
LinkedCommand = custSchema.GeneralInfoFinancialSettings.CustomerClass
},
...
};
Pop-Up Forms
When you click specific buttons on some forms, the system opens a pop-up window with another MYOB Acumatica form where you can specify or edit the values of elements as needed. For example, if you click Add Contact on the Contacts tab of the Customers form, the system displays the Contacts (CR302000) form.
- Call an action that invokes a pop-up form as follows:
- By using the GetSchema() method of the
PX.Soap.Helper
class, get the Content object that corresponds to the form that invokes a pop-up form. - Specify the command that invokes a pop-up form in the sequence of commands by using the corresponding Action command.
- Submit this sequence of commands to the form that invokes the pop-up form by using the corresponding Submit() method.
- By using the GetSchema() method of the
- Specify the values on the pop-up form as follows:
- By using the GetSchema() method of the
PX.Soap.Helper
class, get the Content object that corresponds to the form that appears as a pop-up. - Specify the list of commands that specifies the values of needed elements of the pop-up form.
- Add the Save action to the list of commands.
- Submit this sequence of commands to the pop-up form by using the corresponding Submit() method.
- By using the GetSchema() method of the
//context is a Screen object
//custSchema is an AR303000Content object
var commands = new Command[]
{
new Value
{
Value = customerID,
LinkedCommand = custSchema.CustomerSummary.CustomerID
},
custSchema.Actions.NewContact
};
context.AR303000Submit(commands);
//contSchema is a CR302000Content object
commands = new Command[]
{
new Value
{
Value = "Green",
LinkedCommand = contSchema.DetailsSummary.LastName
},
contSchema.Actions.Save,
};
context.CR302000Submit(commands);