Conditions and Parameters: To Add a Field Parameter to the Selection Area
In this activity, you will learn how to modify an existing generic inquiry to give users the ability to limit the data displayed by a value of some data field. To give users the ability to select that value, you will include a parameter for this data field in the Selection area of the inquiry form.
Story
Suppose that you are a technical specialist in your company who is working on simple customizations, including those involving the creation, modification, and use of generic inquiries. An accountant of your company has requested an inquiry that displays data about invoices and memos. You have offered the predefined Invoices and Memos (AR3010PL) generic inquiry form, but the accountant wants to give users the ability to filter the inquiry results by a particular customer—that is, users should be able to select a particular customer in the Selection area of the resulting generic inquiry form and review only that customer’s invoices and memos.
Configuration Overview
You will work with a copy of the predefined Invoices and Memos (AR3010PL) inquiry form, which has the AR-Invoices and Memos inquiry title and the Invoices and Memos site map title specified on the Generic Inquiry (SM208000) form.
The copy you will work with has the DB5-ARInvoicesMemos inquiry title and the S130 Invoices and Memos site map title specified on the Generic Inquiry form.
Process Overview
On the Results Grid tab of the Generic Inquiry (SM208000) form for the copied inquiry, you will look for the row that corresponds to the Customer column of the inquiry and note the value in the Data Field column. You will add the Customer parameter on the Parameters tab. Then you will specify how the system should apply the value of the parameter to the inquiry output by adding a condition on the Conditions tab.
System Preparation
Launch the MYOB Acumatica website, and sign in to a tenant with the U100 dataset preloaded as system administrator Kimberly Gibbs. You should sign in by using the gibbs username and the 123 password.
Step 1: Adding a Parameter
To modify the generic inquiry to add a parameter, do the following:
- Open the Generic Inquiry (SM208000) form.
- In the Inquiry Title box of the Summary area, select DB5-ARInvoicesMemos.
- On the Results Grid tab, look for the row that corresponds to the Customer column, and note the value in the Data Field column.
- On the Parameters tab, click Add
Row on the table toolbar, and specify the following settings in
the added row:
- Name: Customer
- Schema Field: ARInvoice.CustomerID
- Display Name: Customer
- From Schema: Selected
- On the form toolbar, click Save.
Step 2: Adding a Condition for the Parameter
To modify the generic inquiry by adding a condition, do the following:
- While you are still viewing the DB5-ARInvoicesMemos inquiry, on the
Conditions tab of the Generic Inquiry (SM208000) form, click Add
Row on the table toolbar, and specify the following settings in
the added row:
- Brackets: (
- Data Field: ARInvoice.CustomerID
- Condition: Equals
- From Schema: Cleared
- Value 1: [Customer]
- Operator: Or
- Again click Add Row on the table toolbar, and specify the
following settings in the added row:
- Data Field: [Customer]
- Condition: Is Empty
- From Schema: Cleared
- Brackets: )
- On the form toolbar, click Save.
- Click the eye icon on the side panel to preview how your changes have affected the inquiry form. The system adds the box corresponding to the parameter to the Selection area (see the following screenshot). You can select a particular customer account and view only invoices and memos for the customer, or you can leave the box empty.