Epicor ERP Business Activity Queries Course
Epicor ERP Business Activity Queries Course
Epicor ERP
Business Activity Queries
Course
10.0.700
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 2014.
All rights reserved. No part of this publication may be reproduced in any form without the prior written consent of
Epicor Software Corporation.
ED872905
90521-10-0103-58310700
10.0.700
Revision: June 08, 2014 5:19 p.m.
Total pages: 76
course.ditaval
Contents
Business Activity Queries Course..........................................................................................6
Before You Begin....................................................................................................................7
Audience.........................................................................................................................................................7
Prerequisites....................................................................................................................................................7
Environment Setup..........................................................................................................................................8
Business Activity Queries (BAQs) Overview.........................................................................9
Workshop - Tour the BAQ Designer...............................................................................................................11
Locate an Existing Query.........................................................................................................................11
Review the Query Builder........................................................................................................................11
Updatable BAQ Properties......................................................................................................................12
Analyze a Query.....................................................................................................................................14
Review the Where Used Sheets...............................................................................................................14
Review the BAQ Search Sheet.................................................................................................................14
Application Setup.................................................................................................................16
Field Help Technical Details............................................................................................................................19
Workshop - Use the Field Help................................................................................................................19
Data Dictionary Viewer..................................................................................................................................21
Workshop - Use the Data Dictionary Viewer............................................................................................21
BAQ Application Server Options.....................................................................................................................22
BAQ Design...........................................................................................................................23
The Query Builder..........................................................................................................................................23
Table List................................................................................................................................................24
Table Relations.......................................................................................................................................24
Workshop - Manually Join Tables.....................................................................................................25
Define the Query Tables...........................................................................................................25
Set Table Relations...................................................................................................................26
Select the Columns and Test....................................................................................................26
Workshop - Create a BAQ...............................................................................................................28
Add the BAQ............................................................................................................................28
Select the Tables......................................................................................................................28
Select the Columns..................................................................................................................28
Enter the Sort Order.................................................................................................................29
Analyze and Test the BAQ........................................................................................................29
Selection Criteria....................................................................................................................................31
Display....................................................................................................................................................33
Workshop - Apply Filter and Modify Display Parameters...................................................................34
Define the Part Description Compare Query..............................................................................34
Use Criteria to Filter Open Orders.............................................................................................34
Define the Columns and Test...................................................................................................35
Calculated Field Editor............................................................................................................................37
Import BAQ.....................................................................................................................................71
Generate ASP................................................................................................................................................72
Copy Query...................................................................................................................................................73
Workshop - Copy a Query......................................................................................................................73
Change Author..............................................................................................................................................74
Workshop - Change Author....................................................................................................................74
Conclusion.............................................................................................................................75
This course introduces the Business Activity Query (BAQ) Designer data extraction tool. It discusses data location
concepts and provides an overview of query building techniques using the Query Builder, the Criteria Wizard,
and the Calculated Field Wizard.
This course provides techniques for creating static business activity queries (BAQs) as well as updatable BAQs.
Both queries can be used as the foundation for reports and dashboards, or to review specific details of your
day-to-day business.
The course begins with a discussion on which tools you can use in Epicor ERP Version 10 to locate the table and
field, and understand table relations. It continues with an introduction to BAQ Designer, then covers techniques
you can use to create simple queries, also called FLAT queries. These BAQs are comprised of one TopLevel
SubQuery. The next part of the course explains how to create more complex BAQs, comprised of several SubQueries
of different types, to obtain the desired information from the application database.
The course continues with discussion of the updatable BAQ functionality - a powerful mechanism to share and
update data details when used as the foundation of a dashboard. The updatable BAQ creates a powerful tool
for team collaboration displayed on the standard Epicor application, or modified for display on a mobile device
such as an iPhone®.
The course concludes by exploring BAQ Utilities - additional capabilities such as BAQ export, or changing an
author.
Upon successful completion of this course, you will be able to:
• Use the field level technical help or the data dictionary viewer to locate the table and field criteria for use in
a BAQ.
• Create a simple BAQ using the Query Builder and its query-building views.
• Construct an advanced BAQ comprised of several SubQueries.
• Use the Criteria Wizard to filter the data returned by the BAQ.
• Add calculated and aggregated values to a query using the Calculated Field Wizard.
• Design an updatable BAQ to increase team collaboration.
• Import or export queries between companies, or to a .xml or ASCII file type.
Read this topic for information you should know in order to successfully complete this course.
Audience
Prerequisites
To complete the workshops in this course, the necessary modules must be licensed and operating in your training
environment. For more information on the modules available, contact your Epicor Customer Account Manager
at [email protected]. It is also important 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 available in two user
interface modes - Classic Menu and Modern Shell Menu. Workshops focus on each of these modes and
guide you through each navigational principle introduced.
• 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 as well as join type definitions and specifications.
• Recommended Industry Knowledge:
• Fundamental knowledge of relational database concepts such as table relationships, records, and field
types.
• An understanding of 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.
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.
3. From the Main menu, select the company Epicor Education (EPIC06).
Use the Business Activity Query Designer (BAQ) to create personalized queries. You can use custom queries
and custom updatable queries as the foundation for dashboards, quick searches, and BAQ reports. The exporting
capabilities makes the queries available to view and edit in third party applications.
The BAQ Designer has several components you can use to compile a query:
• Use the Query Builder to drag and drop tables onto the design area. The table properties display on the left
of the design canvas area. If necessary, select the connection link and draw a connection between tables. Use
the filter to quickly access the table name. The Query Builder is composed of the following sheets:
• The Phrase Build sheet is where you select the tables and fields you wish to include in the query. Use this
sheet to set up everything from basic queries with a single table to complex joins between multiple tables.
• The Display Fields sheets define which columns display and in what order they display in the query. You
can also create and display a special calculated field you need within the current business activity query.
• The SubQuery Options sheet is where define subquery parameters. When you construct a BAQ, use this
sheet control what data displays in the SQL output by selecting an appropriate subquery type. You also
have the ability to control the SQL results set. For example, you can construct an SQL text to only display
top 50% of rows from the retrieved results set.
• The SubQuery List sheet displays all subqueries you create within a BAQ. On this sheet, all subqueries
you create are ordered by the sequence number. You have the ability to create and remove subqueries,
change their sequence value and view how data displays in the results set.
Five sheets are available at the bottom of the Phrase Build sheet. Use these sheets to indicate how tables are
linked together, define the relation between the tables, and specify the selection criteria for the query.
• Use the Table List sheet to view the list of tables that make up your query and to change their order.
• Use the Table Relations sheet to display and modify the fields that make up the joins between tables
and subqueries. You can add, modify and delete the join fields within the current query.
• Use the Table Criteria sheet to enter criteria for a table. You can apply one or more filter criteria to any
table in the query.
• Use the SubQuery Criteria to enter criteria for the whole SubQuery. These criteria are used to construct
the WHERE and HAVING clauses in a SELECT statement.
• Use the Function Call Parameters sheet to specify values for the parameters in a Table-Valued Function.
A Table-Valued Function (TVF) is a user-defined function that returns a table.
Menu Path
Navigate to this program from the Main Menu:
• Executive Analysis > Business Activity Management > Setup > Business Activity Query
Important This program is not available in the Epicor Web Access.
This workshop provides a tour of the Business Activity Query (BAQ) Designer using a system query as the
foundation.
Navigate to the Business Activity Query Designer.
Menu Path: Executive Analysis > Business Activity Management > Setup > Business Activity Query
Important This program is not available in the Epicor Web Access.
The BAQ you selected - zCustContact, is an example of a flat query as it constructed using the single main
SubQuery.
Use the Phrase Build sheet to design a query using the visual representation of the current SubQuery. A
SubQuery in general can be made of tables as well as different SubQueries.
On this sheet, you select tables and other SubQueries you wish to include in the current SubQuery. You can
set up everything from basic queries with a single table to complex joins between multiple tables or
SubQueries.
Initially, application database tables display in the table palette in the left pane. To include a table in your
query, select a table and drag it on the canvas in the center pane. You can perform the same action by
double-clicking a table. It is also possible to add multiple tables at the same time. The tables, of which the
query is composed, display as diagram blocks.
Five sheets are available at the bottom of the Phrase Build sheet. Use these sheets to indicate how tables or
SubQueries are linked together, define the relation, and specify the selection criteria for the resulting data
set.
Analyze a Query
After a query is built use the Analyze sheet to check the syntax (Analyze) and to execute the query (Test) to view
results.
A BAQ search is a feature that allows custom BAQs to become a base search criteria for a specific field. It
requires the use of Like columns, which link the BAQ to the specific field used for the search. This is a very
powerful discussed later in the course.
2. On the Standard toolbar, click Clear and minimize Business Activity Query Designer.
Application Setup
The first step to create a query is to find the appropriate data. The Epicor application offers tools you can use to
locate the table and field data for the query.
This section covers the process of table and field name identification, use of the Online Technical Field Help, the
Data Dictionary Viewer functionality, and the Table Relations from Dictionary Tracker embedded within the BAQ
Designer. Also included is a discussion of table relationships and joining styles.
Table Linking
When you use two or more tables in a query, you must identify a link between the tables to pull records from
both tables.
Example
If you use the Quote table and the Customer table, connect the tables so that each quote is matched up
with the customer on the quote.
Table Relationship
If the query pulls data from multiple tables, you must create relationships between tables through a joining
process. Use indexed fields to establish a relationship or join. In general, an index points to the data location. It
is a named path designed within the database using common table fields to quickly locate, store, or retrieve data.
Use the Data Dictionary to identify the index name, path, or index order.
Note
Always use the Company ID field as the first indexed field, since it is at the top of the Epicor application
table hierarchy. The application uses the Company ID field to store the data for each company separately
from the data for other companies. Since all tables use the Company ID field, select it as the first field to
use in a join.
Joining Types
Following are the four basic types of joins you can select in BAQ Designer:
• Inner Join
• Left Outer Join
• Right Outer Join
• Full Join
Important
It is crucial a user explicitly determines the correct order of tables in the query to retrieve the expected
results.
Inner Joins
An inner join, also known as an equal join, is the standard type of join. 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.
Example
The join between the Customer table and the OrderDtl table creates a view that displays customers and
orders placed. In this case, the view includes only customers who have placed an order. Records for any
customers who have not placed an order are excluded.
Use this join to display only matching records between the primary table and the lookup table.
Example
Use a left outer join to view all customers and the orders for these customers, and to retrieve a row for
every customer who has not placed any orders. Fields that otherwise hold the order information display
blank for these customers.
Full Join
In SQL the Full Outer Join combines the results of both left and right outer joins and returns all (matched or
unmatched) rows from the tables on both sides of the join clause.
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.
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.
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. For example, the field displays 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 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
2. Place the cursor in the Field Help sheet header and click the push pin icon to dock the Field Help window.
You can adjust the Field Help width to see the fields properly.
5. Navigate to the Part > Sites > Warehouses > Primary Bin sheet and place the cursor in the 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. Navigate to the Part > Sites > Warehouses > Bin Information > Detail sheet and place the cursor in the
Bin field.
Notice the database field is different.
Note Data is often stored in multiple places, and table selection depends on the purpose of the query.
This example presented a part's listing with a part bin location.
Use the Data Dictionary Viewer 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.
This utility may help you identify the fields and tables to use for a customization, BAQ or custom report. The Data
Dictionary Viewer is also helpful during upgrades, as you can view the current database structure and compare
it against a previous database version.
Tables Sheet
The Data Dictionary is organized by tables. A table is a set of fields that contains related information. Use the
Tables sheet to find and select the database table to review.
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 functionality to display tables
in a grid format. The grid includes a brief overview of the tables and helps you determine which table you should
use when a field is located in more than one table.
Fields Sheet
The Fields > Detail sheet displays all values for a selected field, such as format, label, and description, display
on this sheet.
Example
The customer table includes the identifying code for the customer (CustNum), name (Name), and other
specific customer details.
For information regarding the Data Dictionary Viewer properties, refer to the Technical Details topic in the Field
Help.
This workshop demonstrates how to use the Data Dictionary Viewer to identify fields and tables.
Navigate to the Data Dictionary Viewer.
Menu Path: System Setup > System Maintenance > Data Dictionary Viewer
Several BAQ related options are found within Application Server Settings accessible from the Epicor
Administration Console.
Using the BAQ Query Max Result Rows field, you can limit the number of rows returned by each Business
Activity Query. This prevents the query from pulling in an unlimited number of records, restricting situations
where a runaway BAQ consumes too many system resources to generate query results.
For the BAQ Query Timeout field, you can enter how many seconds can elapse before the application server
stops the query. By entering a value in this field, you define how long each BAQ is allowed to run. When a query
attempts to generate results and reaches this time limit, the application server stops the query and sends the user
a time out message.
To record BAQ database calls within the application log, select the BAQ Logging check box. Each time user
activity activates a BAQ, the application server log records which query was called and how long it took this BAQ
to gather the data results.
BAQ Design
This section describes the process for creating queries using the Business Activity Query Designer.
To include a table, SubQuery or a Table-valued function in your query, select and drag it on the canvas in the
center pane. You can perform the same action by double-clicking on it. It is also possible to make multiple
selection by holding the Ctrl button.
To easily locate the table you want, in the Filtering field, enter a value.
Five sheets are available at the bottom of the Phrase Build sheet. Use these sheets to do the following:
• View the list of tables and SubQueries used in the current SubQuery.
• Define the relation between the tables and SubQueries.
• Specify the selection criteria for the tables and SubQueries.
• Specify values for the parameters in a Table-Valued Function.
Example
To create a query that displays part and bin information, double-click the Erp.Part table and select the
Connected only check box to filter the list of available tables that contain related information to the Part
table. This helps narrow the list of available related tables to select from.
Tip
Instead of selecting tables individually, you may use the Business Objects button to search for and load
table(s) within an entity, for example, Erp.Part. The links between loaded tables are displayed automatically.
The Display Fields sheets define which columns display and in what order they display in the query. You can
also create and display a special calculated field you need within the current business activity query.
The SubQuery Options sheet is where define subquery parameters. When you construct a BAQ, use this sheet
control what data displays in the SQL output by selecting an appropriate subquery type.
The SubQuery List sheet displays all subqueries you create within a BAQ. On this sheet, all subqueries you create
are ordered by the sequence number. You have the ability to create and remove subqueries, change their sequence
value and view how data displays in the results set. You can also use parenthesis to group SubQueries.
Table List
The Query Builder > Phrase Build > Table List displays the list of tables and subqueries you place on the canvas
for the subquery in focus.
If your BAQ incorporates multiple SubQueries, switch between them using the Active SubQuery navigational
toolbar found above the Phrase Build tab.
Table Relations
Use the Table Relations sheet to display and modify the fields that make up the joins between tables. You can
add, modify and delete the join fields within the current query.
Important By default, queries are set up to display Inner Joins, which means that data from the first table
only displays if it is linked to data within the second table. The query output from an inner join includes all
the records in which the table relations values in both tables are an exact match. Records from either table
that do not have a match in the other table are not included in the query results.
Example
Use an inner join to view all customers and the orders they have placed. You will not get a match for any
customer who has not placed orders. Most queries you create only need this type of join.
checks relation with the previous table within the table order. It does not check relations to all possible tables
within the query. This button is enabled when some predefined relation exists in the dictionary for the selected
join connection, and its title contains number of predefined dictionary relations in the parentheses. The Table
Relations from Dictionary window that displays when you click the button list all relations with their fields.
The result relation expression displays in the Expression textbox at the bottom. You can select one of the relations
and press Replace In Query button. As a result, fields from Dictionary form will replace fields used in current
BAQ relation.
This workshop demonstrates creation of a BAQ that requires a manual join of tables.
In this task, assume you would like to create a business activity query that displays the list of parts and for each
part you would like to attach a detailed company information. Within the part table, the company ID information
is available, but for a greater company detail, you will use the company table. You accomplish this task by
designing a BAQ using both tables and specifying the relationship between them.
2. In the Query ID field, enter XXX_Parts (where XXX are your initials) and press Tab.
Important The Query ID can contain any value that does not exceed 30 characters in length and
must not contain invalid symbols such as (/:\*?<> or space.
For the purposes of this workshop, you leave the options described in the table clear.
6. In the Filtering field that displays above the list of tables, enter com.
Notice all tables beginning with Com display in the table window.
Note Epicor tables either belong to the application system ( ERP) or the tools system ( ICE). The
application schema a particular table belongs to displays as a table name prefix.
7. From the tables listing click and drag the Erp.Company table onto the design canvas (grid) area.
9. From the tables listing, select and drag the Erp.Part table onto the workspace (grid) area.
2. From the toolbar above the design canvas area, click the Add Connection icon (chain link icon).
The cursor changes to a cross hair.
3. Click on the Erp.Part Table, hold down the mouse and drag a link to the Erp.Company table.
The tables are connected with the line. At the bottom of the screen, the Table Relations sheet is automatically
selected.
4. To define the relationship between tables, on the Table Relations sheet toolbar, click the Add Row button.
The table join is now defined and columns can be selected for the returned Dataset.
Company
Name
Address1
City
State
6. Click the right arrow to move the selected columns to the list of Display Columns.
7. Click Save.
You are now ready to test the query.
This workshop shows you how to create a BAQ that retrieves part and part bin information. Tables used in this
workshop are directly linked by the application.
The BAQ you design displays part number details, warehouse and bin locations, and quantities on hand.
1. In the Business Activity Query Designer, click New to create a new query.
3. From the list, select the Erp.Part table and drag it on the canvas in the center pane.
4. Click the Connected Tables Only button found above the list of tables.
Recall when this option is selected, the palette only displays the tables that have relations, described in
system tables, with the table selected on the canvas.
5. Scroll down and double-click the Erp.PartBin table to place the table in the center pane.
A linking line between tables displays.
4. To select multiple columns at once, hold Ctrl and select the following columns:
PartDescription
TypeCode
5. Click the blue right arrow button to move the columns to the Display Column(s) list.
BinNum
OnHandQty
LotNum
DimCode
10. Click the blue right arrow button to move the columns to the Display Column(s) list.
3. Click PartNum.
4. Click the blue right arrow button to move the column to the Sort By list.
5. Click Save.
Defining a sort order ensures the data returned by the query displays in a specific way. In this example, the results
display in part number sequence.
4. Right-click anywhere in the BAQ Results grid and select Show Summaries and Show Grid Filters.
You will first apply a filter on the On Hand column to display quantities greater than 0 to exclude parts with
negative inventory balances. This way, you can summarize how many parts in total you have in stock as the
next step.
Important You can place criteria on tables or SubQueries when you design a new BAQ to limit the
data it displays. You will learn how to do it in the workshops that follow. The intention of this task is
to parse the data after it was returned by the BAQ.
8. Click OK.
Selection Criteria
You can control query detail selection using the Table Criteria and SubQuery Criteria sheets.
Note Table criteria are associated with a table, so to see table's criteria you need to select a table on design
surface first. SubQuery criteria are associated with a SubQuery and applied to query result.
• LeftP or RightP - Use these columns to enter left or right parenthesis. Use parenthesis to nest selection criteria.
• Neg - Use the Neg value to indicate a negative value.
• Field Name - The fields of the selected table display in this listing for filtering.
• Compare Operator - Several comparison are available, such as equals, not equal to, and so on.
Important The Epicor database requires all table cells have values, so it does not allow DB NULLS. The
only exclusion is for Date type fields. If you want to find rows with an EMPTY string value, use a comparison
with an empty constant.
To specify an empty string, for the Filter Value, select specified constant and leave the Value field empty.
If you want to find rows with unassigned fields, use the ISNULL operation. This operation may be useful
in external queries which execute against non-Epicor databases.
• current date + specified interval - Use this option to specify date intervals in days, weeks, months, and
years. Select the word specified to open the Select a date window.
• selected value(s) of field from specified subquery - Use this option to compare a field against ANY or
ALL fields retrieved from the selected subquery. Select the word selected to switch between ANY or ALL
subquery field values. Select field from specified to select SubQuery field you want to use in the criterion.
Display
Once you identify the query tables in the Phrase Build, define the remaining query parameters. These parameters
include which fields display as columns, define column headings labels, and sort the data. Additional sheets
analyze the query for syntax, test the query, and identify where the query is used in the Epicor application.
The Display Fields sheet consists of two sub sheets:
• Use the Display Fields > Column Select sheet to define the columns that display on your query.
You can use this sheet to set up the order in which the selected columns display in BAQ results and
consequently, in dashboards or reports that will use the BAQ as the datasource. You can also configure the
display names for each column and create a calculation for a selected field. The display names display on the
query instead of the default column name.
Example
The default column name taken from the database is Customer.CustID. You can configure the display
name for this column as Customer ID.
• The Display > Sort Order sheet displays the selected tables in the order they were selected. One or more
table and field combinations can be used to define the order of the query data display.
By default, the fields in each table display in schema order. Use the A to Z icon to sort all tables and fields
alphabetically.
This workshop explains how to use table criteria to limit BAQ results and change parameters of display columns.
The BAQ you create in this workshop displays all open sales order detail lines. The OrderDtl table used in this
workshop has a boolean field for open orders. You will use the OrderDtl.OpenLine field to limit the dataset to
open sales orders.
When users enter a new line in Sales Order Entry and select an existing part, the Order Line Description field
(OrderDtl.LineDesc) field automatically defaults to part description found in part master table (Part.Description).
In the BAQ, you will display both database fields and verify entries are the same.
1. In the Business Activity Query Designer, click New to create a new query.
2. In the Filtering field enter ord then drag the Erp.OrderDtl table onto the design canvas (grid).
4. In the Filtering field enter par then drag the Erp.Part table on to the design canvas (grid).
The tables automatically link.
8. From the toolbar above the Criteria sheet header, select the A-Z icon.
This sorts the fields in alphabetical order for easy access.
2. From the toolbar in the Available Columns, click the Sort columns alphabetically (A to Z icon).
Tables and fields always sort schematically by default. The Sort icon places all the details in alphabetical
order.
4. From the field listing select and click the right arrow to advance the following to the Display Column(s)
area:
Field Name
LineDesc
OrderLine
OrderNum
PartNum
Request Date
6. From the field listing select and advance the following to the Display Column(s) area:
Field Name
NetVolume
NetWeight
PartDescription
You can change the field names to save confusion on labels such as Desc (OrderDtl) and Description (Part).
9. Click Save.
You are now ready to test the query.
Use the Calculated Field Editor to create user-defined columns based on a calculation of selected fields within
the query. You can either create new fields or modify existing ones that came over from a copied query.
Example
• Editor - The Editor pane displays the calculation you create. A warning displays if a table or field is selected
that is not in the query.
To the right side of the editor box, use the buttons to quickly enter operators. This section also contains
additional symbols and the Check Syntax button.
The Check Syntax button verifies the correct syntax of the calculated field.
The functions and operators you drop in the editor box or enter through the right side buttons have trailing
spaces. If the character field placed before the functions or operators on the screen does not include a space,
a leading space is inserted to assist in using the correct syntax.
A Calculated field can be a mathematical field or a field that is defined using other fields in the database to
provide query specific data.
This workshop shows how to create a calculated field to display total labor and burden hours for each shop
employee. The Employee Basic (EmpBasic) table from the Shop Employee Maintenance provides the employee
details. Join this table to the Labor Details (LaborDtl) which holds details from the time and expense entry. Filter
results against a specific date and create calculated fields to generate the total labor and burden hours.
1. In the Business Activity Query Designer, click New to create a new query.
2. In the Filtering field enter Em, then drag the Erp.EmpBasic table onto the design canvas (grid).
4. From the table listing, drag the Erp.LaborDtl table on to the design canvas (grid).
The tables automatically link. The data is to be filtered based on a cutoff payroll date.
7. From the toolbar above the Table Criteria sheet header, click the Add Row button.
The new line displays.
14. From the toolbar above the Criteria sheet header, click the Add Row button.
3. From the Available Columns, expand the EmpBasic node and move Name into the Display Column(s)
area.
4. In the Display Columns grid, for the EmpBasic_Name column, select the Group By check box.
Create a calculated field to total each employee's labor hours using the Aggregate function.
9. In the Fields section, expand the Available tables > LaborDtl node and double-click LaborHrs.
Verify the Editor displays the following calculation:
sum( LaborDtl.LaborHrs )
12. Repeat steps 6 through 11 to create the calculated field BurdenHrs. Use the Sum(x) function and select
LaborDtl.BurdenHrs.
Verify the Editor displays the following calculation:
sum( LaborDtl.BurdenHrs )
The calculated field displays in the Display Column(s) section. The label can be modified if desired.
2. Click the Test button to execute the query and return the records.
The query returns the employee listing and displays the total labor and burden hours for each employee.
3. Click Save.
The true power of the Business Activity Query (BAQ) goes beyond pulling data details from the database. Use
this tool to create updatable BAQs, that can be used to design updatable smart client, mobile or SharePoint
Publisher dashboards.
Security Requirements
Updating BAQs is considered an advanced operation and requires the user id to have the following two security
permissions.
• BAQ Advanced User
• BPM Advanced User
Contact your System Administrator to ensure the correct security levels are assigned to your user id.
A Business Activity Query (BAQ) can be updated as a query, or added to a dashboard to create an updatable
dashboard. They are frequently used on dashboards.
Example
The order entry department is looking to update the sales orders as quickly as possible. You have been
asked to create an updatable BAQ that would allow the addition of new sales orders within the grid.
Order information is stored by the sales order in several different tables. Create the query using the OrderHed
and OrderDtl tables to bring in the sales order and order line details. Each table is explained below:
• OrderHed - The OrderHed table holds the sales order header information such as Bill to and Ship to
customer numbers, purchase orders, shipping terms and so on. Create the first query to allow entry of
a sales order with no lines.
• OrderDtl - The OrderDtl table holds all the line item details, but not releases. Create a second query
to allow line details to update an existing sales order.
Important The following workshops require the user id to have BPM Advanced Developer and BAQ
Advanced Developer permissions. Verify these permissions have been granted using the User Account
Maintenance program.
1. In the Business Activity Query Designer, click New to create a new query.
2. In the Query ID field, enter XXX_Orders (where XXX are your initials) and press Tab.
12. Move the following fields into the Display Column(s) section and change the field labels as noted:
Tip For easier field search, sort columns alphabetically.
4. Click the Check All Fields as Updatable icon (the white checked box icon).
Tip You can also individually select the Updatable check box for specific fields.
5. From the Query Field List, clear the Updatable check box for the OrderNum field.
This expression maps the two numbers so that one entry on the CustNum field populates both. This expressions
assumes the two numbers are always the same and may not apply in your environment.
5. In the OrderHed_PONum field, delete the existing entry and enter any number.
6. Click OK.
The line you modified becomes highlighted. Notice the Order Number, Bill To Customer and Ship To Customer
fields display in a different color. Recall Bill To Customer and Ship To Customer fields have been modified
using calculated fields that automatically assign customer number values. This visual indicator can help you
identify which fields the BAQ affects when the Update method executes.
10. Click the Order Nbr column heading to sort orders in descending order. Locate and write down the newly
created sales order number ______.
1. Click the Sales Order button to browse for and select sales order 5198.
On the Header section, notice the PO number change made.
2. Click the Sales Order button and to browse for and select the new order number from the Create a New
Sales Order workshop.
Verify the new order and ensure accuracy in the data.
3. Exit the Sales Order Tracker and maximize the Business Activity Query Designer.
1. In the Business Activity Query Designer, click New to create a new query.
2. In the Query ID field, enter XXX_OrderLines (where XXX are your initials) and press Tab.
7. Hold Ctrl, select Erp.OrderHed and Erp.OrderDtl tables and move them on the designer canvas.
10. Move the following fields into the Display Column(s) section and change the field labels as follows:
To select multiple columns, press and hold Ctrl to select the columns.
12. Move the following fields into the Display Column(s) section and change the field labels as follows:
To select multiple columns, Press and hold Ctrl to select the columns.
4. Click the Check All Fields as Updatable icon (the white checked box icon).
8. In the Suggested business objects section, select the Erp.SalesOrder object and click OK.
9. In the Tables to update pane, ensure both OrderHed and OrderDtl are selected. Both tables are part of
the same business object so they can be updated both at once.
4. From the Query Result Fields list in the middle of the form, double-click OrderDtl_Company.
This step maps the OrderHed.Company field to the OrderDtl.Company field.
When the list refreshes, the new order number should display with a single order line. By default, the sales order
also has one release.
1. On the Analyze sheet, in the Query Results grid, right-click the Order Number you created.
2. From the Context menu, select Open With ... > Sales Order Tracker.
The tracker opens the record for the sales order you indicated.
Note Multiple tables can be used in an updatable BAQ as long as the tables all belong to the same business
object.
Using SubQueries
A SubQuery is a query that is nested inside a SELECT statement, or inside another SubQuery. A SubQuery can
be used anywhere an expression is allowed. Each Business Activity Query can contain one main SubQuery, where
Type=TopLevel and several SubQueries of different type to indicate how they correlate with each other.
SubQueries give different advantages for query design, including:
• Support of widely used query criteria as IN ({inner subquery}), EXISTS ({inner subquery})
• Using common table expressions (CTE), including CTE with recursion and UNION ALL for querying hierarchical
data
• Using CTE and inner SubQuery in the FROM clause and joins
• Using set operations, like UNION, UNION ALL, EXCEPT, INTERCEPT
By default, a simple query contains only one SubQuery with the following attributes:
Field Value
Name SubQuery1
Type TopLevel
Results Row Set All
When designing a new SubQuery, the following types are available for selection:
Type Description
TopLevel Default value for simple query; each BAQ can contain one main TopLevel SubQuery.
Union The UNION command is used to select related information from two tables, much like the
JOIN command. However, when using the UNION command all selected columns need to be
of the same data type. With Union, only distinct values are selected.
Type Description
UnionAll The UNION ALL command is equal to the UNION command, except that UNION ALL selects
all values.
The difference between Union and Union all is that Union all will not eliminate duplicate
rows, instead it just pulls all rows from all tables fitting your query specifics and combines
them into a table.
Intersect Use the INTERSECT command to return the results of two or more select queries. However,
it only returns the rows selected by all queries. If a record exists in one query and not in the
other, it will be omitted from the results.
Except Returns any distinct values from the query to the left of the EXCEPT operand that are not
also returned from the right query.
CTE A common table expression (CTE) can be thought of as a temporary result set that is defined
within the execution scope of a single SELECT, INSERT, UPDATE, DELETE, or CREATE VIEW
statement.
A CTE is similar to a derived table in that it is not stored as an object and lasts only for the
duration of the query. Using a CTE offers the advantages of improved readability and ease
in maintenance of complex queries. The query can be divided into separate, simple, logical
building blocks. These simple blocks can then be used to build more complex, interim CTEs
until the final result set is generated.
InnerSubQuery InnerSubQuery is usually added in the WHERE Clause of the SQL statement as a nested query
inside another query. Most of the time, a subquery is used when you know how to search
for a value using a SELECT statement, but do not know the exact value.
Important
In BAQ Designer, SubQueries are concatenated in the sequential order, so one or more SubQueries of
Union, UnionAll, Except, Intercept types can go after TopLevel, or CTE SubQueries.
When one or more SubQueries are combined using the above set operators, their fields, specified on the Display
Fields > Columns Select sheet should conform to the following rules:
• The number and the order of the columns must be the same in all SubQueries.
• The data types must be compatible, through implicit conversion.
• Field aliases of the result record set are taken from the first SubQuery.
You also have the ability to control the SQL result set by modifying the SELECT keyword. The following options
are available for selection in the Result Set Row field:
Keyword Description
All Default value; the SELECT ALL command returns all data without restriction.
Distinct SELECT DISTINCT specifies that only unique rows can display in the result set.
Top SELECT TOP clause specifies the number of rows or percent of rows to return.
You can either a number or percent of rows the result set displays.
WITH TIES specifies that the query result set includes any additional rows that match the
values in the ORDER BY column or columns in the last row returned. This may cause more
rows to be returned. TOP...WITH TIES can be specified only in SELECT statements, and only
if an ORDER BY clause is specified.
Keyword Description
Important TOP as well as DISTINCT TOP cannot be combined with OFFSET and FETCH
in the same query expression.
DistinctTop SELECT DISTINCT TOP corresponds to using DISTINCT and TOP clauses simultaneously. The
query results set contains top unique rows.
The Offset and Fetch fields provide you with an option to fetch only a window or page of results from the result
set.
Argument Description
Offset Specifies the number of rows to skip, before starting to return rows from the query expression.
Example This BAQ skips first 5 rows from the sorted result set of all employees and
returns the remaining rows.
select
[EmpBasic].[EmpID] as [EmpBasic_EmpID],
[EmpBasic].[FirstName] as [EmpBasic_FirstName],
[EmpBasic].[LastName] as [EmpBasic_LastName]
from Erp.EmpBasic as EmpBasic
order by EmpBasic.EmpID OFFSET 5 ROWS
Fetch Specifies the number of rows to return, after processing the OFFSET clause.
Example This BAQ skips first 5 rows from the sorted result set and returns next 10 rows
from the employees table.
select
[EmpBasic].[EmpID] as [EmpBasic_EmpID],
[EmpBasic].[FirstName] as [EmpBasic_FirstName],
[EmpBasic].[LastName] as [EmpBasic_LastName]
from Erp.EmpBasic as EmpBasic
order by EmpBasic.EmpID OFFSET 5 ROWS FETCH NEXT 10 ROWS ON
LY
The OFFSET/FETCH rowcount expression can be any arithmetic, constant, or parameter expression that will return
an integer value.
Please be aware of the following limitations:
• Using OFFSET/FETCH requires MS SQL Server 2012 or later.
• ORDER BY clause is mandatory to use OFFSET and FETCH clause.
• OFFSET clause is mandatory with FETCH. You can never use, ORDER BY … FETCH.
• TOP/DISTINCT TOP cannot be combined with OFFSET and FETCH in the same query expression.
• OFFSET and FETCH cannot be combined with TOP/DISTINCT TOP keywords in the same query expression.
In this workshop, create the BAQ that counts open, closed and total amount of orders per customer. Create two
SubQueries that will count open and closed orders and group them together by customer. The information
obtained by the Inner SubQueries will be presented by the TopLevel SubQuery you will create at the end of this
workshop.
1. In the Business Activity Query Designer, click New to create a new query.
2. For the Query ID, enter XXX_OrderCount, where XXX are your initials.
7. From the list, select the Erp.OrderHed table and drag it on the canvas in the center pane.
9. From the toolbar, click the Add Row to add new line.
Select Columns
4. Select the Group By check box to indicate you want the group open orders by customer.
10. To indicate you want to count all open order records, inside the brackets, enter * (asterisk).
14. For SubQuery 1 you just created, in the Type field, select InnerSubQuery.
This indicates this SubQuery will become a nested query inside the TopLevel BAQ you will create later.
2. On the Query Builder > SubQuery Options sheet, accept the following defaults:
Name Type
SubQuery2 InnerSubQuery
5. From the list, select the Erp.OrderHed table and drag it on the canvas in the center pane.
8. From the toolbar, click the Add Row to add new line.
Select Columns
4. Select the Group By check box to indicate you want the group closed orders by customer.
8. In the Editor pane, manually add the calculation that counts all closed orders.
count( * )
5. Search for and add the Erp.Customer table on the canvas in the center pane.
6. Above the table listing, click the SubQueries button to displays the list of available SubQueries.
8. From the toolbar above the canvas, select the Add Connection icon (chain links).
The cursor turns to a cross-hair.
9. Click on the Erp.Customer table and drag a line to the SubQuery1 table, then release.
2. Expand the Customer table and move the Name field to the list of Display Column(s).
3. Expand the SubQuery1 and move the Calculated_CountOpen field to the list of Display Column(s).
4. Expand the SubQuery2 and move the Calculated_CountClosed field to the list of Display Column(s).
2. Click Test.
In this workshop, build a BAQ that displays total value breakdown of sales for a given day.
This BAQ will provide information on total values of:
• Quotes entered in the sales pipeline.
• Orders booked in the system.
• Invoices sent to customers.
You accomplish this task by creating a BAQ comprised of three SubQueries and combine their results into one
dataset.
1. In the Business Activity Query Designer, click New to create a new query.
2. In the Query ID field, enter XXX_SalesValue (where XXX are your initials) and press Tab.
Column Name
QuoteHed_Company
Customer_Name
QuoteHed_QuoteNum
QuoteHed_EntryDate
9. For each of the above columns, select the Group By check box.
Field Value
FieldName QuoteSum
Data Type decimal
Label Total Value
16. In the Fields section, expand the Available tables > QuoteHed node and double-click QuoteAmt.
Verify the Editor displays the following calculation:
sum( QuoteHed.QuoteAmt )
18. Move the Calculated_SubQueryName column up and make it the first column in the list.
The grid displays the list of quotes and their total amounts. Notice the Document Type column indicates all records
belong to the Quotes category. In the following tasks you will add two more SubQueries that retrieve similar
data for Orders and Invoices and have all results display in one grid.
8. Since the Customer table is already used in the BAQ definition, accept the proposed table alias.
Example
By default, the table name defaults to Customer1.
Column Name
OrderHed_Company
Customer1_Name
OrderHed_OrderNum
Column Name
OrderHed_OrderDate
11. For each of the above columns, select the Group By check box.
Field Value
FieldName OrderSum
Data Type decimal
Label Total Value
18. In the Fields section, expand the Available tables > OrderHed node and double-click OrderAmt.
Verify the Editor displays the following calculation:
sum( OrderHed.OrderAmt )
20. Move the Calculated_SubQueryName1 column up and make it the first column in the list.
Note Recall the number and the order of the columns is the same as specified in the TopLevel
SubQuery.
Column Name
InvcHead_Company
Customer2_Name
InvcHead_InvoiceNum
InvcHead_InvoiceDate
10. For each of the above columns, select the Group By check box.
Field Value
FieldName InvoiceSum
Data Type decimal
Label Total Value
17. In the Fields section, expand the Available tables > InvcHead node and double-click InvoiceAmt.
Verify the Editor displays the following calculation:
sum( InvcHead.InvoiceAmt )
19. Move the Calculated_SubQueryName2 column up and make it the first column in the list.
14. Verify the Date parameter you created is highlighted and click Select.
15. Repeat steps 7 - 14 to apply the same filter on OrderHed and QuoteHed SubQueries. To switch between
SubQueries, use the Active SubQuery toolbar.
Use the below table for reference:
3. To test the BAQ, you can use the following dates that have sales records in the Demonstration Database.
Date
02/01/2010 (February 1st)
04/01/2009 (April 1st)
01/02/2009 (January 2nd)
4. Right-click anywhere in the grid and select Show Group By and Show Summaries.
8. You BAQ results are now broken down by Quotes, Orders and Invoices with their total values for a given
day.
Example
BAQ Search
Use the BAQ Search sheet to select data in your query that you want to make available to users searching for
related data.
Every Search form has a sheet called BAQ Search. This feature provides an opportunity to create your own type
of search criteria.
Example
Your BAQ for parts uses two columns from the Part table: Part.PartNum and Part.PartDescription. These
are the columns you selected on the Display sheet. Both columns are listed in the Available Like Columns
section of the BAQ Search sheet.
Your own BAQ becomes an option for a part number search. If you select the Shared check box on the
Detail sheet of the qiuery, all users can use the BAQ as a unique search mechanism.
Since there are no searches based on part description as the record key, selecting the Part.PartDescription
column for the BAQ Search Like Column is not useful.
Note You can not select application queries on the BAQ Search sheet. Application queries come loaded
with the Epicor application and always start with the prefix z. For example, zAPCheckDtl.
This workshop explains how to create a BAQ search using the query created in the previous workshop. Enable
the query to be become a search mechanism throughout the Epicor application.
2. Click Query ID, and search for and select the XXX_Parts query (where XXX are your initials).
5. Click the blue arrow button to move the selected column to the BAQ Search "Like" Columns list.
6. Click Save.
3. Select the XXX_Parts (where XXX are your initials) query and click Search.
The Search Results pane in the search window displays the query information you can use to search for a
part.
Since the Part Number field was selected as the Like column for searching, any place you can search for
a part has this BAQ listed and available for searching.
Cross-Company Queries
Use this feature to create and run Business Activity Queries (BAQ) against multiple companies within a single
Epicor ERP installation.
The functionality allows you to run multi-company dashboards with a single BAQ call.
To enable a Cross-Company query creation for a user, in User Account Maintenance, select the Allow Creation
of Cross Company BAQ check box. This check box only controls the ability to create and maintain Cross-Company
BAQs.
Execution of Cross-Company BAQs is filtered by companies the user has security access to.
Field Security is also applied in accordance with settings for each company since these may differ.
Example If the user has no access to AbcCode.CountFreq field in EPIC02 company and has no access to
AbcCode.PcntTolerance field in EPIC03 then all rows returned for AbcCodes from EPIC02 company will
contain empty CountFreq field and empty PcntTolerance field for EPIC03 company.
The External Business Activity Query related programs provide an extension to the standard Business Activity
Query capability. External BAQs provide the mechanism for retrieving, updating and displaying information from
an external database using the SQL language.
The process of creating an external BAQ involves the following:
• Establish a connection to an external datasource using the ADO .NET DB provider available on the server and
compose a connection string to access the external database management system.
• Enable the external datasource you create in the company you work with.
• Set up security restrictions to schema and data coming from an external datasource as required.
• Modify external datasource metadata specified in the source database as required.
• Build an external Business Activity Query and use it as a datasource for reports, dashboards, trackers and so
on.
• Expose the data to users using the Epicor Everywhere ™ Framework tools.
BAQ Zones
BAQ (Business Activity Query) zone is an embedded query you can link to a specific field on a program interface.
When you activate a BAQ zone, it displays as a linked tool tip window. The data that populates this window
depends on both the business activity query and current value, if any, within the linked field.
You create and modify business activity queries within the BAQ Designer. Use this custom query tool to select
and join tables. You then define what columns from the selected tables display in the results. Through this
functionality, you can also create calculated fields that run an expression against the query results to return unique
values. These custom queries display the data you want; you can then link these queries as BAQ zones.
After you create or modify the BAQ you will use for the BAQ zone, you then link the BAQ to a specific field by
either using Extended Property Maintenance, Context Menu Maintenance or embedding the BAQ zone in
a customization. When a BAQ zone is linked to a field, a zone indicator displays on a program interface during
Rune Mode. These zone indicators display as arrow buttons next to the field.
For more information on BAQ Zones, review the Advanced Embedded Customization course and the
Application Help.
BAQ Utilities
The Actions menu of the Business Activity Query (BAQ) Designer contains several functions. These functions
provide additional capabilities that pertain to the query currently in focus on the screen. This section reviews
some of these options for managing BAQs.
By default, a Business Activity Query is linked to the company in which they are created. The same query can be
exported from one company and imported into another as long as the database structures are the same.
Import BAQ
Use the Import BAQ option to import a query that was previously exported.
Example Typically, use the export and import BAQ functionality to reuse a query in another company.
Moreover, the import functionality lets you pull in BAQs created in previous versions of the Epicor application.
While the BAQ is imported, its definition is uplifted so you can use the imported BAQ in Epicor ERP Version
10, utilizing the ICE 3 framework.
When you import the BAQ, you can change the query's identifier. You can also indicate that this query should
be immediately displayed within the Business Activity Query Designer. Within the Designer, you can check the
imported query works properly and perform necessary adjustments in BAQ design as required.
Revert to Saved
Use the Revert to Saved option to restore the saved version of the current Business Activity Query. All changes
that you made to the current query are removed, and the query reverts back to its previously saved version.
This workshop demonstrates how to export the PartBin query created in an earlier workshop and then import it
into the Epicor application with a new name.
Export BAQ
2. Click Query ID, search for and select any BAQ you created in this course.
9. Click Export.
A message displays in the Export processes message window indicating a successful export, or errors that
occur.
Import BAQ
1. In Business Activity Query Designer, from the Actions menu, select Import BAQ.
6. In the New Query ID field, enter XXX_Import (where XXX are your initials).
Generate ASP
Use the Generate ASP option to convert a query to an .asp page. You can display this page on your website,
updated with current information from your database.
Use this program to both select which query fields you want to display and define the search options you use
with this data. You may also change the name of field columns. To finish generating the page, name the ASP
file and save it within your web deployment directory.
File Types
Once you click the Generate ASP button, the Epicor application creates two files within the selected directory:
• .asp – This is the file referenced by your company website.
• .xsl – This is the file that sorts and displays data results on the .asp page.
Copy Query
Use the Copy Query option to duplicate the current Business Activity Query. This allows you to use an existing
query as a base for a new query that you need.
Note
System queries (with a z prefix in their IDs) are the default queries required for the Epicor Application to
run. You cannot edit system queries, however, the Copy Query option allows you to duplicate the query.
You can edit and customize this duplicate query as you need.
2. Click the Query ID button, and search for and select zCustomerShipments.
4. In the Copy To section, in the Query ID field, enter XXX_CustShip (where XXX are your initials).
6. The copied query displays within the Business Activity Query Designer.
7. Remain in the Business Activity Query Designer with XXX_CustShip BAQ in focus.
Change Author
Use the Change Author option from the Actions menu command to change the author name of the current
Business Activity Query. By default, queries can only be updated by the user who created the query, known as
the author. You can use the Change Author option to reassign the author of a query to a different user.
Once you change the author, the Epicor application uses the new author identifier immediately. The new author
is allowed to update the query as needed.
The Change Author functionality is beneficial when a user leaves the organization or changes roles. It can also
be helpful when a more experienced user within an organization helps a less experienced user with formulas,
filtering, and so on.
3. Click the Author button, and search for and select Steven Tyler (STyler).
4. Click OK.
View the red Other Owner. No Save message that displays.
This message indicates you cannot make changes to the query as it is assigned to a different author. To
change the current query or to select a different author, you must log in as STyler.
Conclusion