Generic Inquiries and OData: To Expose Inquiry Results Through OData
In this activity, you will learn how to modify an existing generic inquiry to expose its results through OData.
Story
Suppose that you are a technical specialist in your company who is working on simple customizations, including the creation and modification of generic inquiry forms. An accountant of your company has asked you to provide access to the predefined Invoices and Memos (AR3010PL) inquiry form through Microsoft Excel. The accountant uses Excel for building reports based on the data of this inquiry and would like for the data to always be up to date. Further suppose that the access role of the accountant is Accountant.
Process Overview
On the Generic Inquiry (SM208000) form, you will verify that the AR-Invoices and Memos generic inquiry complies with the requirements for a generic inquiry to be exposed through OData—that is, it has been published. You will select the Expose via OData check box for the generic inquiry and save your changes.
After the results of the generic inquiry are exposed, you will make sure that the accountant (whose user account is assigned the Accountant role) has sufficient access rights for the inquiry form by using the Access Rights by Screen (SM201020) form.
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: Exposing the Inquiry
To expose the needed generic inquiry results by using OData, do the following:
- Open the Generic Inquiry (SM208000) form.
- In the Inquiry Title box of the Summary area, select AR-Invoices and Memos.
- Verify that a screen identifier has been assigned in the Screen
ID box. Notice that the Workspace and
Category boxes are cleared. Tip:An inquiry form is considered published as long as the Screen ID box is filled in on the Generic Inquiry form.
- Select the Expose via OData check box.
- On the form toolbar, click Save.
Step 2: Specifying the Access Rights to the Exposed Inquiry
To specify the access rights of the Accountant role to the exposed inquiry, do the following:
- Open the Access Rights by Screen (SM201020) form. Because no workspace is specified for the AR-Invoices and Memos generic inquiry on the Generic Inquiry (SM208000) form, you need to search for this generic inquiry in the Hidden node of the left pane.
- In the Hidden node of the left pane, click
Invoices and Memos with the AR3010PL screen ID
(see Item 1 in the following screenshot).Tip:The system displays a tooltip with the screen identifier when you point to a node; this can help you find the needed form when multiple forms have the same name.
- In the right pane, in the Access Rights column of the row
with the Accountant role, select the
View
Only level (Item 2).
Figure 1. The level of access rights of the Accountant role for the exposed inquiry
- On the form toolbar, click Save.