Você está na página 1de 20

Epicor 9 Database Concepts Course

9.05.601

Disclaimer
This document is for informational purposes only and is subject to change without notice. This document and its contents, including the viewpoints, dates and functional content expressed herein are believed to be accurate as of its date of publication. However, Epicor Software Corporation makes no guarantee, representations or warranties with regard to the enclosed information and specifically disclaims any applicable implied warranties, such as fitness for a particular purpose, merchantability, satisfactory quality or reasonable skill and care. As each user of Epicor software is likely to be unique in their requirements in the use of such software and their business processes, users of this document are always advised to discuss the content of this document with their Epicor account manager. All information contained herein is subject to change without notice and changes to this document since printing and other important information about the software product are made or published in release notes, and you are urged to obtain the current release notes for the software product. We welcome user comments and reserve the right to revise this publication and/or make improvements or changes to the products or programs described in this publication at any time, without notice. The usage of any Epicor software shall be pursuant to an Epicor end user license agreement and the performance of any consulting services by Epicor personnel shall be pursuant to Epicor's standard services terms and conditions. Usage of the solution(s) described in this document with other Epicor software or third party products may require the purchase of licenses for such other products. Where any software is expressed to be compliant with local laws or requirements in this document, such compliance is not a warranty and is based solely on Epicor's current understanding of such laws and requirements. All laws and requirements are subject to varying interpretations as well as to change and accordingly Epicor cannot guarantee that the software will be compliant and up to date with such changes. All statements of platform and product compatibility in this document shall be considered individually in relation to the products referred to in the relevant statement, i.e., where any Epicor software is stated to be compatible with one product and also stated to be compatible with another product, it should not be interpreted that such Epicor software is compatible with both of the products running at the same time on the same platform or environment. Additionally platform or product compatibility may require the application of Epicor or third-party updates, patches and/or service packs and Epicor has no responsibility for compatibility issues which may be caused by updates, patches and/or service packs released by third parties after the date of publication of this document. Epicor is a registered trademark and/or trademark of Epicor Software Corporation in the United States, certain other countries and/or the EU. All other trademarks mentioned are the property of their respective owners. Copyright Epicor Software Corporation 2010. All rights reserved. No part of this publication may be reproduced in any form without the prior written consent of Epicor Software Corporation.

EDE8510905 90521-905-9231-583601 9.05.601 Revision: August 31, 2010

TOC | 3

Contents
Database Concepts Course.....................................................................................................4 Before You Begin....................................................................................................................5
Audience.........................................................................................................................................................5 Prerequisites....................................................................................................................................................5 Environment Setup..........................................................................................................................................5

Overview.................................................................................................................................7 Identify Table and Field Names.............................................................................................8


Field Help Technical Details..............................................................................................................................8 Workshop - Use the Field Help................................................................................................................10 Customization Tools......................................................................................................................................11 Workshop - Reference Customization Tools............................................................................................12 Activate Developer Mode................................................................................................................12 Identify Table and Field Names........................................................................................................12 Deactivate Developer Mode.............................................................................................................13 Data Dictionary Viewer..................................................................................................................................13 Tables.....................................................................................................................................................13 Fields......................................................................................................................................................13 Workshop - Use the Data Dictionary Viewer............................................................................................15

Table Linking.........................................................................................................................16
Dataset Relationships Tracker.........................................................................................................................17 Additional Information............................................................................................................................17 Workshop - Display the Dataset Relationships Tracker.............................................................................18 Join Types......................................................................................................................................................18

Conclusion.............................................................................................................................20

Epicor 9 | 9.05.601

4 | Database Concepts Course

Database Concepts Course


This course reviews the table and field name identification process using Field Help, Customization Tools, and the Data Dictionary Viewer functionality. It also describes table linking procedures and requirements, Dataset Relationships Tracker features, and join type definitions and specifications. A fundamental requirement when modifying or authoring custom reports or queries is to identify which tables within the database contain the needed data, and which field names are used to store that data. Hands-on workshops guide you through examples of each task. Upon successful completion of this course, you will be able to: Explore table and field name identification methods, including Field Help, Customization Tools, and the Data Dictionary Viewer functionality. Identify relationships between parent and child tables and understand the linking processes and requirements. Display the Dataset Relationships Tracker to identify the fields to include in the join that links the selected tables. Define the available table join types of inner, left outer, and right outer joins.

Epicor Software

Before You Begin | 5

Before You Begin


Read this topic for information you should know in order to successfully complete this course.

Audience
Specific audiences will benefit from this course. IT/Technical Staff System Administrators

Prerequisites
In order to complete the workshops in this course, all necessary modules must be licensed and operating in your training environment. For more information on the modules available, contact your Epicor Customer Account Manager EpicorCAM@epicor.com. It is also important that you understand the prerequisite knowledge contained in other valuable courses. Navigation Course - This course introduces navigational aspects of the Epicor application's user interface. Designed for a hands-on environment, general navigation principles and techniques are available at each of the interface levels in the Epicor application - system, module, and program. Workshops focus on each of these levels and guide you through each navigational principle introduced. Recommended Industry Knowledge: Experience in other database generator programs. Fundamental knowledge of relational database concepts, such as table relationships, records, and field types. Understanding the functionality of the current release of the Epicor application.

Environment Setup
The environment setup steps and potential workshop constraints must be reviewed in order to successfully complete the workshops in this course. Your Epicor training environment, in which the Epicor demonstration database is found, enables you to experience Epicor functionality in action but does not affect data in your live, production environment. The following steps must be taken to successfully complete the workshops in this course.

Epicor 9 | 9.05.601

6 | Database Concepts Course 1. Verify the following or ask your system administrator to verify for you: Your Epicor training icon (or web address if you are using Epicor Web Access) points to your Epicor training environment with the Epicor demonstration database installed. Do not complete the course workshops in your live, production environment. Note It is recommended that multiple Epicor demonstration databases are installed. Contact Support or Systems Consulting for billable assistance. The Epicor demonstration database is at the same service pack and patch as the Epicor application. Epicor's education team updates the Epicor demonstration database for each service pack and patch. If your system administrator upgrades your Epicor application to a new service pack or patch, he or she must also download the corresponding Epicor demonstration database from EPICweb > Support > Epicor > Downloads and install it. If this is not performed, unexpected results can occur when completing the course workshops. Your system administrator restored (refreshed) the Epicor demonstration database prior to starting this course. The Epicor demonstration database comes standard with parts, customers, sales orders, and so on, already defined. If the Epicor demonstration database is shared with multiple users (that is, the database is located on a server and users access the same data, much like your live, production environment) and is not periodically refreshed, unexpected results can occur. For example, if a course workshop requires you to ship a sales order that came standard in the Epicor demonstration database, but a different user already completed this workshop and the Epicor demonstration database was not restored (refreshed), then you will not be able to ship the sales order. Epicor's education team has written the course workshops to minimize situations like this from occurring, but Epicor cannot prevent users from manipulating the data in your installation of the Epicor demonstration database. 2. Log into the training environment using the credentials manager/manager. If you are logged into your training environment as a different user, from the Options menu, select Change User. From the Main menu, select the company Epicor USA (EPIC03). From the Main menu, select the Main Plant.

3. 4.

Epicor Software

Overview | 7

Overview
The following section provides an overview of the database topics related to the custom report generation process. Field and Table Name Identification When writing custom reports and queries, a fundamental requirement is to identify the tables within the database that contain the data required for the report. Additionally, you must identify the names of the fields used to store the data. The Customization Tools, the Data Dictionary Viewer, and the Field Help > Technical Details sheet are helpful tools for field and table name identification. Field Help > Technical Details The Field Help feature is a quick reference tool that provides a brief description of the field and a technical property reference for the selected field. It also provides data dictionary details for the field in focus on the maintenance program. Customization Tools Customization Tools are designed to modify system sheets and displays. In this course, you will use Customization Tools only as a look-up tool to help identify table and field names. Data Dictionary Viewer Use the Data Dictionary Viewer to identify the fields and tables needed for a customization or a custom report. This program is also an aid during upgrades, as you can view the current database structure to compare it against a previous database version. Table Linking Processes and Requirements This course also discusses the table linking process and requirements. This involves topics relative to table join concepts, requirements, and the use of indexed fields to create the table link. Using the Dataset Relationships Tracker and applying the appropriate join type aid in the table linking process. Dataset Relationships Tracker The Dataset Relationships Tracker displays the relationships between the Epicor application dataset in a dashboard format. Use this tracker to create custom reports and queries, as it helps you create joins between the tables within the query or report. Join Types Once you understand the table linking process, the next step is to define the three join types available when writing a custom Crystal report: inner, left outer, and right outer joins.

Epicor 9 | 9.05.601

8 | Database Concepts Course

Identify Table and Field Names


The first requirement of any report or query is to locate the data. The Epicor database is a relational database and therefore, all data is stored in a collection of tables and fields. A common question occurs when writing reports or queries, especially for the report writer who is not familiar with the database structure and naming conventions. The question is, I know where the data is entered and located, but where do I find the table and field name? This is a typical question, and the answer becomes easier over time as you are exposed to the database. For purposes of writing a custom report or query, you already know where certain data that is critical to the report is entered. What is not necessarily known is the specific database table or field names for the data. Application tools are available that aid in table and field identification. These tools include the Field Help, Customization Tools, and the Data Dictionary Viewer. When you create a query or report, the type of information you need in the query and a time frame is usually all the information you receive. Next comes the challenge of determining where the data is located. Every user interface form is a small database that contains a collection of tables and fields that display data. First determine how and where the information was entered in the Epicor application. For example, a query or report is built to demonstrate a part listing that displays part and part bin information. Ask yourself the following questions: 1. What kind of information should I include in a query or report that displays parts? - Write down probable fields. Where do I enter part information on parts? - Part Maintenance What is a part bin? - A place in a warehouse that holds parts Where do I enter part bin information? - Enter part bin information in the Warehouse Maintenance table or the Warehouse Bin Maintenance table. These tables are in the Part > Plants > Warehouse > Bins sheet in Part Maintenance.

2. 3. 4.

Field Help Technical Details


The Field Help feature is a quick reference tool that provides a brief field description and the technical property reference for selected fields. To enable Field Help, from the Help menu, select Field Help and click a field in the interface. The Field Help sheet contains two menu items: Field Level Help - The Field Level Help is a text description of the field from the Application Help. You can use Field Help as a learning tool, as it allows you to access documentation for each field. Technical Details - The technical details include the data dictionary information for the field. Use technical specifications for a field when building business activity queries (BAQs) and using Business Process Management (BPM) methods and other advanced functions of the Epicor application.

Epicor Software

Identify Table and Field Names | 9 Note To view technical details, you must have permission to access the corresponding business object. This permission is set in Process Security Maintenance for the bo.DataDict business object. The technical details of the Field Help are valuable in understanding the table structure of the database. Keep in mind that data can reside in multiple tables. The query topic displays where the data comes from. You can also use the Customization feature to locate tables and fields.

Epicor 9 | 9.05.601

10 | Database Concepts Course

Workshop - Use the Field Help


In this workshop, use the Field Help to find table and field names. The Field Help provides a Technical Details sheet to display the data dictionary information for a selected field. The properties that display are helpful when you create a business activity query and discuss the Data Dictionary Viewer. Field Name - This displays the field name as defined by the Epicor application. This name is used in all expressions. EpiBinding - This displays the table name and the field name. In this case, the field is Part.PartNum, which means the table to use is the Part table and the field to pull into the query is the Part field. The syntax is always <Tablename.Fieldname>. DB Field - This displays the database field property which also displays as <Tablename.Fieldname>. Format - This is the Progress database format for this field and the number of characters to which that field is limited. Like - Use this field to validate a BAQ search and generate Foreign Key Views to indicate the common field between two tables or datasets. Navigate to Part Maintenance. Menu Path: Material Management > Inventory Management > Setup > Part 1. From the Help menu, select Field Help. In the tree view pane, the Field Help sheet displays. It automatically opens in an undocked position. 2. Place the cursor in the Field Help sheet header and click the push pin icon to dock the Field Help window. 3. Place the cursor in the Part field. 4. In the Field Help sheet, click Technical Details. You can adjust the Field Help width to see the fields properly. 5. Navigate to the Part > Plants > Warehouses > Detail sheet and place the cursor in the Primary Bin field. The properties populate with the data in this field. The table and field combination display in the EpiBinding field of the Technical Details in the format of <table>.<field>. 6. Record the table and field _____________________. Note Data is often stored in multiple places, and table selection depends on the purpose of the query. This example presents a parts listing with a part bin location.

7. Navigate to the Part > Plants > Warehouse > Bin Information > Detail sheet and place the cursor in the Bin field. Record the table and field ________________________. 8. Exit Part Maintenance.

Epicor Software

Identify Table and Field Names | 11

Customization Tools
Use the Customization tools as an alternate method of identifying tables and fields. Example To create a shipping activity report that lists the tracking number assigned to the shipment, use the Customization Tools to locate and identify the name of the table and field that contain this data.

Epicor 9 | 9.05.601

12 | Database Concepts Course

Workshop - Reference Customization Tools


In this workshop, reference the Customization Tools.

Activate Developer Mode


Developer mode is not available unless the user has customization permission. With this permission, you can modify any sheet or window. Grant these privileges with caution. Navigate to User Account Maintenance. Menu Path: System Management > Company Maintenance > User 1. In the User ID field, search for and select System Manager (MANAGER). 2. Navigate to the Security sheet. 3. Verify the Customize Privileges check box is selected. 4. Click Save and exit User Account Maintenance. 5. From the Main menu, select Options > Developer Mode. In the Standard toolbar, notice the Developer Mode icon has an orange background when Developer mode is active.

Identify Table and Field Names


Navigate to Customer Shipment Entry. Menu Path: Material Management > Shipping / Receiving > General Operations > Customer Shipment Entry 1. In the Select Customization window, click OK to accept the defaults and open the program. 2. Navigate to the Header > Detail sheet. 3. From the Tools menu, select Customization. The Customization Tools Dialog window displays. 4. Move or resize the Customization Tools Dialog window so the Tracking Number field is visible. 5. In the Customer Shipment Entry window, click the Tracking Number field. 6. In the Customization Tools Dialog window, in the EpiControl section, in the EpiBinding field, view the table and field names. The full identifier for the Tracking Number field is ShipHead.TrackingNumber. This means the field name is TrackingNumber and it is located in the ShipHeadList table. 7. Review the same information for the Pack ID field. 8. Close the Customization Tools Dialog window and exit Customer Shipment Entry and don't save changes. 9. Close the Customer Shipment Entry window.

Epicor Software

Identify Table and Field Names | 13

Deactivate Developer Mode


1. From the Main menu, select Options > Developer Mode. 2. Notice the Developer Mode icon no longer has an orange background.

Data Dictionary Viewer


The Data Dictionary Viewer allows you to find and review details of each field and table within the database. It helps you better understand the purpose and data values of each field. Use the Data Dictionary Viewer to identify the fields and tables you want for a customization or a custom report. This program is also an aid during upgrades, as you can view the current database structure to compare it against a previous database version. Tip You can also print a hard copy of the data dictionary and use this report as a reference guide during upgrades and customizations. For more information on how to run this report, refer to the Data Dictionary Field Report topic. Menu Path Navigate to this program from the Main Menu: System Management > Data Dictionary Viewer

Tables
Data Dictionary Viewer > Tables Use the Tables sheet to find and select the database table to review. The Data Dictionary Viewer is organized by tables. A table is a set of fields that contain related information. Example Use the Customer table to store all your customer records. The OrderHed table records your order header records. Data is often stored in multiple tables, each with a specific purpose. Use the Search option to display tables in a grid format. The grid includes a brief overview of the tables and helps determine which table to use when a field is located in more than one table.

Fields
Data Dictionary Viewer > Fields > Detail Use the Fields sheet to display specific information about each selected field. All values for a selected field, such as format, label, and description, display on this sheet. Each table contains various fields. These items are individual pieces of information associated with the table. Each field has a unique name.

Epicor 9 | 9.05.601

14 | Database Concepts Course Note The customer table includes the identifying code for the customer (CustNum), name (Name), and other specific details about the customer. The Data Dictionary Viewer properties are also available in the Technical Details area of the Field Help. When accessed through the Field Help, the details are specific to the selected field.

Epicor Software

Identify Table and Field Names | 15

Workshop - Use the Data Dictionary Viewer


This workshop demonstrates how to use the Data Dictionary Viewer to identify fields and tables. Navigate to the Data Dictionary Viewer. Menu Path: System Management > Data Dictionary Viewer 1. In the Table field, enter OrderHed and press Tab. Information populates in the Tables sheet, the Fields sheet, and the tree view. 2. Navigate to the Tables sheet. 3. In the Description field, review the table description. 4. In the Indexes grid, view the IndexFields column. 5. In the Display Format pane, select Alphabetic. This option sorts fields alphabetically. 6. Navigate to the Fields > Detail sheet. 7. In the Field Name field, select DiscountPercent. 8. Review the information and click Clear. 9. Exit the Data Dictionary Viewer.

Epicor 9 | 9.05.601

16 | Database Concepts Course

Table Linking
In the table selection process, it is important to link tables together. Use one or more common fields to aid in reporting by selecting field data from multiple tables to create links. Table Links Link tables so the records from one table match related records from another. This linking process involves using a common field between the selected tables. For example, if you activate an Orders table and a Customers table, link the tables so each order from the Orders table can be matched with the customer from the Customer table that made the order. Reporting or querying tools use this connection to identify related records between tables. In the above example, the linking process ensures the data in each line of the report refers to the same order. Table Link Requirements Table link requirements involve linking from one table to another. The from table is the primary table, while the to table is the lookup table where records are looked up by the primary table. For example, if the Quote is the primary table, the querying or reporting tool chronologically goes field by field through the Quote table and searches for matching records in the second table, which can be customers, until all fields are evaluated. Link Types The main link types are one table to another or one table to multiple others. One table to another - The primary table and the lookup table have a one-to-one relationship between their records. One table to multiple others - The primary table and the lookup table have a one-to-many relationship between their records. Indexed Fields An index field points to a data location which is a named path designed within the database in order to quickly locate and store data or to easily retrieve data in a table. The index name and path, or index order, are identified in the Data Dictionary Viewer and on the Field Help > Technical Details sheet. Note Always use the Company field as it is the first indexed field and it is located at the top of the Epicor application table hierarchy. The data of each company is stored and separated from other company data using the Company ID field. Since every table uses the Company field, it is an indexed field and you must select it as one of the fields to use in a join. There are no exceptions to this rule. You must select the Company field as a join field pair when linking tables because company is at the top of the table hierarchy in the Epicor application. Your report will not provide the correct results if this field is not used in the join.

Epicor Software

Table Linking | 17

Dataset Relationships Tracker


Dataset Relationships displays relationships between the Epicor application dataset within a dashboard format. Use this table to create custom reports and queries, as it can help you create joins between tables. Example You want to create a custom query between the Customer and Ship To tables, but do not know what join to select. Within the Dataset Relationships Tracker, expand the Customer node, expand the Customer parent table, and then expand the ShipTo child table. Note the correct join is Company and CustNum. Unlike other dashboard trackers, the Dataset Relationships Tracker automatically groups its grid by Dataset ID, Parent table, and Child field. The Parent-Child table displays the Parent table, its related Child field, and its sequence. This helps to illustrate the database hierarchy. Example The OrderHead table is the parent table to the OrderDtl table, and the Part table is the parent table to the PartPlant table. Before you use a tracker, refer to the Tracker Overview topic in the Application Help to learn about its general program functionality. The overview topic explains the tracker interface and how to search for specific records. The topic also contains definitions of concepts and terms. For more information on dashboards and dashboard capabilities, refer to the Dashboard Overview topic in the Application Help. This topic contains links to other dashboard topics that explain how to personalize and customize dashboards. Menu Path Navigate to this program from the Main Menu: System Management > Dataset Relationships

Additional Information
The following concepts help you search for and view field information. Advanced Search Use the Advanced Search features to locate specific field data. Enter the Dataset ID, Parent data table, or Child data table. Click the Refresh button to search for a specific value(s). Dataset Relationships Grid To display the data for all records that link to this tracker, click the Refresh All button. The tracker retrieves all linked records, starting with the first record, and displays the datasets in the Dataset Relationships grid.

Epicor 9 | 9.05.601

18 | Database Concepts Course

Workshop - Display the Dataset Relationships Tracker


This workshop demonstrates how to use the Dataset Relationships Tracker. Navigate to Dataset Relationships. Menu Path: System Management > Dataset Relationships 1. Navigate to the Advanced Search sheet. 2. On the Standard toolbar, click Clear. 3. In the Parent Data Table field, enter OrderDtl. 4. In the Child Data Table field, enter OrderRel. 5. Click Refresh to display the part Dataset ID. Note When you select the green Refresh All button, all related tables populate on the Dataset Relationships sheet.

6. Navigate to the Dataset Relationships sheet to view the relationship between the OrderDtl and OrderRel tables. Record the join fields _______________________________________. 7. Exit Dataset Relationships. If an Advanced Search does not return a dataset, the tables do not directly relate. This does not mean you cannot join them. Use the Data Dictionary Viewer to determine probable join fields.

Join Types
This section defines the three available types of joins and identifies when each type is used during the report creation process. The join types are inner join, left outer join, and right outer join. Inner Joins An inner join, also known as an equal join, is the standard join type. The report output from an inner join includes all the records in which the linked field value in both tables is an exact match. Records from either table that do not have a match in the other table are excluded from the report. The following diagram shows this relationship:

Epicor Software

Table Linking | 19 Example Join the Customer table to the OrderDtl table and create a view of customers and the orders they placed. In this case, only customers with placed orders are included in the report. Records for customers who have not placed orders are excluded. This join is typically used when the report needs to display only matching records between the primary table and the lookup table. Left Outer Joins The report output from a left outer join includes all the records in which the linked field value in both tables is an exact match. It also includes a row for every record in the primary, or left, table in which the linked field value has no match in the lookup table. Crystal Reports fills in the record fields with empty values when there is no exact match. The following diagram shows this relationship:

Example When using a left outer join to view all customers and orders the customers placed, you also get a row for every customer who has not placed any orders. These customers display with blanks in the fields that would otherwise hold order information. Right Outer Joins In general, a right outer join works in exactly the same way as a left outer join, but in reverse. The report output from a right outer join includes all the records in which the linked field value in both tables is an exact match. It also includes a row for every record in the lookup, or right, table in which the linked field value has no match in the primary table. Again, Crystal Reports fills in the record fields with empty values when there is no match. The following diagram shows this relationship:

As in the previous example, when using a right outer join to view all customers and orders they have placed, you also get a row for every order without an assigned customer. These orders display with blanks in the fields that would otherwise hold order information. The use of right outer joins is discouraged, as you can always rewrite your report to use left outer joins, which tend to be more portable and easier to read and use.

Epicor 9 | 9.05.601

20 | Database Concepts Course

Conclusion
Congratulations! You have completed the Database Concepts course. Please take a moment to let Epicor know how to serve you better by completing a course evaluation at http://www.keysurvey.com/survey/191084/2e21/ or by clicking the Course Evaluation link below. Your feedback provides the guidelines for the future direction of Epicor education.

Epicor Software

Você também pode gostar