Skip to main content
Lesson 2

Discovering DACs

Back to S150: Report Designer

Lesson 2: Discovering DACs

This lesson explains how to inspect user interface elements to find the related data access classes and data fields.

DAC Discovery: General Information

In Acumatica ERP, the data is stored in a database. However, users of Acumatica ERP do not access the database directly. Instead, they access the data access classes (DACs), as shown in the illustration below. A data access class is a programming object used to represent and provide access to a database table in the code of Acumatica ERP.

Data access classes contain data fields that hold different data that has been entered in Acumatica ERP. The data fields that you select to retrieve data from will be the columns of the resulting generic inquiry form or will be linked to elements of the resulting report. To work with a generic inquiry or report, you need to find the data access classes and data fields that underlie the key elements on the relevant data entry form or forms. To do this, you inspect these user interface elements. For detailed descriptions of data access classes used by Acumatica ERP, look for the needed DAC in the DAC Schema Browser. (For details about the DAC Schema Browser, see Data from Multiple Data Sources: DAC Schema Browser.)

Learning Objectives

In this lesson, you will learn how to inspect UI elements to find the underlying data fields.

Applicable Scenarios

You may need to discover DACs when you are responsible for the customization of Acumatica ERP in your company, and you need to modify an existing generic inquiry or report to better meet the needs of a particular group of users or all users. Before you start to modify the inquiry or report, you need to find out what DACs store the data that you want to modify. For this purpose, you need to inspect the needed UI elements.

Inspection of UI Elements

You usually create or modify a generic inquiry or report to retrieve data related to some business purpose, so you know which data you need to retrieve. Thus, you have to explore which data access classes and data fields you can use to access this data. To find the underlying data access classes and fields, you explore the forms related to the needed data. For example, suppose that you want to find the data field that holds the reference number of a sales order. When you save a sales order on the Sales Orders (SO301000) form, the system assigns a reference number to it. To find out Lesson 2: Discovering DACs | 15

which data class and data field correspond to the sales order reference number, you open this form, press Ctrl+Alt and click the Order Nbr. element on the form (see Item 1 in the screenshot below).

          As an alternative, you can click Customization > Inspect Element on the form title bar and then click
          the needed UI element.

The Element Properties dialog box opens. You are interested in the values in the Data Class and Data Field boxes (Item 2 in the following screenshot), which correspond to the data access class and data field you need to specify when you modify the generic inquiry or report.

Figure: Form element inspection

You use the Data Class values you discover when you add data access classes on the Data Sources tab of the Generic Inquiry (SM208000) form for a generic inquiry or on the Tables tab of the Schema Builder in the Report Designer for a report. The generic inquiry or report can access various data fields of the data access classes that are listed on this tab. You will use the Data Field value to customize various generic inquiry parameters, conditions, and listed items in the results grid (that is, the table of the generic inquiry form that shows its results). In the Report Designer, you will use the Data Field value to customize report parameters and filters, to specify data sorting and grouping, and to link the elements with the data to be displayed in the report.

Inspection of an Element with a Drop-Down Control If you are inspecting an element with a drop-down control (see Item 1 in the following screenshot), you can also view the list of values for the element. To do this, in the Element Properties dialog box, you click the Drop-Down Values button (Item 2) and the system displays the Drop-Down Values dialog box (Item 3). In the dialog box, you can review the list of options available for the drop-down control. The Value column lists the values stored in the database, and the Description column lists the corresponding captions that are displayed on the user interface. You use the values from the Value column in complex conditions and in formulas in generic inquiries and reports. Lesson 2: Discovering DACs | 16

Figure: Inspection of a form element with a drop-down control

Detailed Information About DACs

You can get more information about the data access class structure and its data fields by using the functionality of the Element Properties dialog box (see Item 1 in the following screenshot). In the dialog box, you can click the link with the data access class name (Item 2). The system opens the DAC Schema Browser in a new browser tab with information about the selected data access class (Item 3). For more information about the DAC Schema Browser, see Data from Multiple Data Sources: DAC Schema Browser.

Figure: Form element inspection

Also, you can click Actions > View Data Class Source... in the dialog box (see Item 1 in the following screenshot). The system opens the Source Code (SM204570) form in a pop-up window with the details of the data access class (Item 2). Lesson 2: Discovering DACs | 17

Figure: Form element inspection

DAC Names and Aliases

The full name of any data access class consists of the namespace and the class name. For example, PX.Objects.AR.ARPayment is the full name of the data access class that holds information about accounts receivable payments, where PX.Objects.AR is the namespace and ARPayment is the class name. For each data access class, you can specify a shortened version of the name used to designate the table. For example, ARPayment can be used as the alias for the PX.Objects.AR.ARPayment data access class. You use aliases to specify (on other tabs of the form) which data access class the system will use to access a data field for a generic inquiry. The following screenshot shows the list of data access classes and their aliases for the SO-SalesOrder generic inquiry (with the Sales Orders site map title).

Figure: The list of data access classes and their aliases

In the Acumatica Report Designer, you can specify aliases (if needed) on the Relationships tab of the Schema Builder. The following screenshot shows the aliases specified for some tables on the Relationships tab of the Schema Builder. Lesson 2: Discovering DACs | 18

Figure: Aliases in the Schema Builder of the Report Designer

DAC Discovery: To Inspect UI Elements

The following activity will walk you through the process of inspecting the user interface elements on Acumatica ERP forms to find the data access classes (DACs) and data fields related to these elements.

          This activity is based on the U100 dataset. If you are using another dataset, or if any system settings
          have been changed in U100, these changes can affect the workflow of the activity and the results of
          the processing. To avoid any issues, restore the U100 dataset to its initial state.

Story

Suppose that you are a technical specialist in your company who is working on simple customizations. A sales representative has requested that you create a generic inquiry that lists sales orders. The inquiry should include the following data for each listed sales order: the sales order number, the order type, the status, the date, and the customer name. To get started in this effort, you need to inspect the relevant user interface elements on the Sales Orders (SO301000) form and the Customers (AR303000) form—the data entry forms on which sales orders and customers are created—in order to figure out which data access classes and data fields are related to them. (In this activity, you will only inspect the UI elements. You will not develop the generic inquiry.)

Process Overview

In this activity, you will inspect the relevant user interface elements of the entry forms whose data will be used in the generic inquiry. To do this, for each relevant element on the form, you will invoke the Element Properties dialog box, which displays the data access class and data field you will need when you develop the generic inquiry. Lesson 2: Discovering DACs | 19

System Preparation

Launch the Acumatica ERP 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.

         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: Inspecting the UI Elements To inspect the UI elements, do the following:

  1. Open the Sales Orders (SO301000) form, which displays a single sales order.
  2. Point to the Order Type box, press Ctrl+Alt, and then click. The Element Properties dialog box opens.
                  As an alternative, you can click Customization > Inspect Element on the form title bar and
                  then click the needed UI element.
    
       Note the values of the Data Class and Data Field elements (SOOrder and OrderType, respectively), which are
       the data access class and field you need.
       The Data Class value reflects a data access class you need to add on the Data Sources tab of the Generic
       Inquiry (SM208000) form, so that the inquiry can access various data fields of the data access class. You will
       use the Data Field value when you customize various generic inquiry parameters and conditions, as well as
       listed items on the results grid (that is, the table showing the inquiry results).
    
  3. Close the dialog box.
  4. Inspect the UI elements listed in the UI Element column of the following table, and make a note of the data access class and data field of each element. Make sure that you get the same results as the following table shows.
        UI Element                              Data Access Class                 Data Field
    
        Order Nbr.                              SOOrder                           OrderNbr
    
        Status                                  SOOrder                           Status
    
        Date                                    SOOrder                           OrderDate
    
  5. Open the Customers (AR303000) form.
  6. Point to the Customer ID box, press Ctrl+Alt, and then click. The Element Properties dialog box opens.
  7. Make a note of the values in the Data Class and Data Field boxes (Customer and AcctCD, respectively), which are the data access class and data field you need.
  8. Close the dialog box.
  9. On the General tab, inspect the Account Name element. Notice that the Data Class and Data Field values are Customer and AcctName, respectively. 10.Close the dialog box. Lesson 3: Creating a Report | 20