Conditions and Parameters: To Add Period-Range Parameters 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 to a specific range of financial periods—that is, to add boxes corresponding to parameters to define the range.
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 form that displays data about invoices and memos. You have offered the predefined Invoices and Memos (AR3010PL) inquiry form, but the accountant has asked you to design the inquiry form to give users the ability to limit the results to a user-defined range of financial periods—that is, a user should be able to specify the needed range of periods.
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 DB4-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 Post Period column of the inquiry and note the value in the Data Field column. You will add two parameters (Period From and Period To) on the Parameters tab. Then you will specify how the system should apply the values of these parameters to the inquiry results 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: Inspecting the UI Elements
To inspect the UI element, do the following:
- Open the Invoices and Memos (AR301000) form, which displays a single invoice.
- Point to the Post Period box, press Ctrl+Alt, and then
click. The Element Properties dialog box opens.
Make a note of the value in the Data Field box (FinPeriodID).
- Close the dialog box.
Step 2: Adding Parameters
To modify the generic inquiry to add parameters, do the following:
- Open the Generic Inquiry (SM208000) form.
- In the Inquiry Title box of the Summary area, select DB4-ARInvoicesMemos.
- On the Results Grid tab, look for the row that corresponds to the Post Period column, and make note of the value in the Data Field column (FinPeriodID).
- On the Parameters tab, click Add
Row on the table toolbar, and specify the following settings in
the added row:
- Name: PeriodFrom
- Schema Field: ARInvoice.FinPeriodID
- Display Name: Period From
- From Schema: Selected
- Default Value: 01-2023
- Again click Add Row on the table toolbar, and specify the
following settings in the added row:
- Name: PeriodTo
- Schema Field: ARInvoice.FinPeriodID
- Display Name: Period To
- From Schema: Selected
- Default Value: 02-2024
- On the form toolbar, click Save.
Step 3: Adding a Condition for the Parameters
To modify the generic inquiry by adding a condition, do the following:
- While you are still viewing the DB4-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:
- Data Field: ARInvoice.FinPeriodID
- Condition: Is Between
- From Schema: Cleared
- Value 1: [PeriodFrom]
- Value 2: [PeriodTo]
- On the form toolbar, click Save.
- Click the eye icon on the side panel to preview how your changes have affected the inquiry. The system has added the boxes corresponding to the parameters to the Selection area (see the following screenshot). You can specify a range of financial periods and view only the invoices and memos within the range of specified financial periods.
Self-Test Exercise
Now that you have learned about conditions and parameters, you should change the condition for the inquiry you have developed in this activity, so that the inquiry will return records if a user has cleared either box or both boxes in the Selection area.