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, which has the AR-Invoices and Memos inquiry title and the Invoices and Memos site map title specified on the Generic Inquiry (SM208000) 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 inquiry complies with the requirements for a generic inquiry to be exposed through OData—that is, it is published and has no parameters. You will select the Expose via OData check box for the generic inquiry and save your changes.

After the inquiry is 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 Advanced website, and sign in to a tenant with the U100 dataset preloaded as system administrator Kimberly Gibbs by using the gibbs username and the 123 password.

Tip: The gibbs user is assigned the Administrator role, which has sufficient access rights to manage the system configuration and to modify generic inquiries, advanced filters, pivot tables, and dashboards.

Step 1: Exposing the Inquiry

To expose the needed generic inquiry by using OData, do the following:

  1. Open the Generic Inquiry (SM208000) form.
  2. In the Inquiry Title box of the Summary area, select AR-Invoices and Memos.
  3. Verify that the Make Visible on the UI check box is selected, a title is present in the Site Map Title box, and a screen identifier is assigned in the Screen ID box. Notice that the Workspace and Category boxes are cleared; these settings cause the system to put the inquiry in the Hidden node of the site map tree.
    Tip: An inquiry form is considered published even if it is located in the Hidden node of the site map tree as long as the Make Visible on the UI check box is selected and the Screen ID box is filled in on the Generic Inquiry form.
  4. On the Parameters tab, verify that no parameters have been defined for the inquiry.
    Tip: For an inquiry to be exposed, either no parameters should be defined, as is the case here, or the inquiry parameters should be deactivated (that is, the check box in the Active column should be cleared for each of them on this tab) and the related conditions should be deactivated (on the Conditions tab).
  5. In the Summary area of the form, select the Expose via OData check box.
  6. 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:

  1. Open the Access Rights by Screen (SM201020) form.
  2. In the left pane, click Invoices and Memos (AR3010PL) in the Hidden node (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.
  3. In the right pane, in the Access Rights column of the row with the Accountant role, select the Delete level (Item 2).
    Figure 1. The level of access rights of the Accountant role for the exposed inquiry


  4. On the form toolbar, click Save.