EpicorICETools UserGuide 102700
EpicorICETools UserGuide 102700
10.2.700
Revision: January 28, 2021 11:36 a.m.
Total pages: 1311
sys.ditaval
Epicor ICE 3.2 Tools User Guide Contents
Contents
Introduction..........................................................................................................................19
10.2.700 3
Contents Epicor ICE 3.2 Tools User Guide
Change Author......................................................................................................................183
Run BPM Designer..................................................................................................................184
Define Custom Action............................................................................................................186
Define Parameters..................................................................................................................187
Execution Settings..................................................................................................................188
Get Query Execution Plan.......................................................................................................193
Change Security Code............................................................................................................195
Reset Field Attributes Cache...................................................................................................196
Export Query Data.......................................................................................................................................197
BAQ Application Server Settings...................................................................................................................199
BAQ Info Zones............................................................................................................................................202
Activate a BAQ Zone.............................................................................................................................202
BAQ Field Security........................................................................................................................................203
BAQ Best Practices.......................................................................................................................................203
Case Studies................................................................................................................................................204
Labor Summary BAQ............................................................................................................................204
Define the Query...........................................................................................................................205
Select and Create Columns for Display...........................................................................................208
Not Clocked Out BAQ...........................................................................................................................212
Define the Query...........................................................................................................................213
Select Columns for Display............................................................................................................215
Simple Updatable BAQ.........................................................................................................................218
Define the Query...........................................................................................................................218
Define Basic Processing Details......................................................................................................220
Update and Create Supplier Records..............................................................................................222
Advanced Updatable BAQ....................................................................................................................228
Create New BAQ...........................................................................................................................228
Select Display Columns..................................................................................................................231
Select Updatable Fields..................................................................................................................233
Specify Update Processing Method................................................................................................235
Analyze Tracing Log......................................................................................................................236
Use Updatable Field Editor.............................................................................................................246
Tour Updatable BAQ Method Directives.........................................................................................249
Create New Directive.....................................................................................................................252
Test Events....................................................................................................................................256
Configure Customer ID Condition.................................................................................................259
Configure BO Call.........................................................................................................................261
Fill TableSet Variable......................................................................................................................265
Add Remaining Customer Change Methods..................................................................................270
Update ttResults Table...................................................................................................................275
Build ShipTo Change Workflow Branch.........................................................................................283
Build Ship By Date Assignment Workflow Branch...........................................................................287
Complete the Directive..................................................................................................................291
Test BAQ Results...........................................................................................................................293
Using Inner SubQueries.........................................................................................................................299
4 10.2.700
Epicor ICE 3.2 Tools User Guide Contents
10.2.700 5
Contents Epicor ICE 3.2 Tools User Guide
Chapter 4: Searches.......................................................................................466
Default Search Interface...............................................................................................................................466
Default Features...................................................................................................................................466
Hot Key Searches..................................................................................................................................469
Quick Searches............................................................................................................................................471
Create a Quick Search..........................................................................................................................472
Activate Quick Search....................................................................................................................472
Quick Search Detail Sheet..............................................................................................................473
Quick Search Criteria.....................................................................................................................476
Test a Quick Search.......................................................................................................................481
Display a Quick Search..........................................................................................................................482
Quick Search Tab...........................................................................................................................482
Context Menu Options..................................................................................................................484
Default Search Program.................................................................................................................485
Business Activity Query Searches..................................................................................................................488
Enable BAQ Search Fields......................................................................................................................488
6 10.2.700
Epicor ICE 3.2 Tools User Guide Contents
10.2.700 7
Contents Epicor ICE 3.2 Tools User Guide
8 10.2.700
Epicor ICE 3.2 Tools User Guide Contents
Set By Query..........................................................................................................................622
Set Field.................................................................................................................................623
Set Argument/Variable...........................................................................................................624
Fill Table By Query..................................................................................................................625
Update Table By Query...........................................................................................................627
Processing Asynchronous Actions.........................................................................................................629
Support for Multiple Dirty Rows............................................................................................................630
Dependent Directives...................................................................................................................................631
Primary Directive...................................................................................................................................631
Dependent Directive.............................................................................................................................631
Epicor Functions...........................................................................................................................................631
Functions Roles.....................................................................................................................................632
Assigning Users to Functions Security Groups................................................................................633
Summary of Security Rights by Role...............................................................................................633
Types of Functions................................................................................................................................634
Creating Function.................................................................................................................................635
Add a Library.................................................................................................................................635
Add References......................................................................................................................637
Set Up Security.......................................................................................................................641
Add a Widget Function..................................................................................................................642
Set Up Main Properties...........................................................................................................642
Define Parameters..................................................................................................................643
Design Function.....................................................................................................................645
Add a Custom Code Function........................................................................................................676
Function Editor.......................................................................................................................677
Copying Function.................................................................................................................................687
Exporting Library...................................................................................................................................688
Importing Library..................................................................................................................................689
Publishing/Unpublishing Library............................................................................................................694
Calling Function from BPM Directive.....................................................................................................696
Add a New Function......................................................................................................................697
Design Function Workflow.....................................................................................................697
Create an Order (Optional)............................................................................................................705
Add BPM Directive 1......................................................................................................................706
Add BPM Directive 2......................................................................................................................707
Test Function Calls.........................................................................................................................709
Calling Function via REST......................................................................................................................710
Calling Function from Client Customization..........................................................................................713
Create the REST Client...................................................................................................................713
Specify Call Context......................................................................................................................715
Execute Call...................................................................................................................................717
Handle Response...........................................................................................................................719
Scheduling Functions............................................................................................................................720
Schedule a Function......................................................................................................................720
Installing Libraries.................................................................................................................................721
10.2.700 9
Contents Epicor ICE 3.2 Tools User Guide
10 10.2.700
Epicor ICE 3.2 Tools User Guide Contents
10.2.700 11
Contents Epicor ICE 3.2 Tools User Guide
12 10.2.700
Epicor ICE 3.2 Tools User Guide Contents
Chapter 9: Dashboards..................................................................................959
Standard System Dashboards.......................................................................................................................959
Navigate in a Dashboard.......................................................................................................................960
Conduct an Advanced Search...............................................................................................................964
Assign Dashboard Developer Rights.............................................................................................................965
Dashboard Creation.....................................................................................................................................966
Dashboard Developer Mode.................................................................................................................966
Add a Query to the Dashboard.............................................................................................................970
Add the Query...............................................................................................................................970
Modify Query Properties.......................................................................................................................975
General Properties.........................................................................................................................975
Publish to Title Bar.........................................................................................................................977
Apply Filters to a Query.................................................................................................................979
The Grid View.......................................................................................................................................981
The Grid Properties Window..........................................................................................................982
Change Display Columns and Enable Group By and Summarization in a Grid.........................982
Change the Grid Display.........................................................................................................985
Apply a Filter to a Grid...........................................................................................................990
Add a New Grid View to the Dashboard.................................................................................991
Add a Rule to Highlight Cells..................................................................................................995
Add an Image Column to a Grid Based on a Rule...................................................................999
The Chart View...................................................................................................................................1004
The Chart Properties Window......................................................................................................1004
Add a Chart View.................................................................................................................1004
10.2.700 13
Contents Epicor ICE 3.2 Tools User Guide
Chart Settings.............................................................................................................................1007
Modify Chart Settings..........................................................................................................1007
The Tracker View................................................................................................................................1010
The Tracker Properties Window...................................................................................................1011
Add a Tracker View for an Advanced Search.........................................................................1011
Add an Advanced Search with Range...................................................................................1013
The Gauge View.................................................................................................................................1020
The Gauge Properties Window....................................................................................................1020
Add a Gauge View to the Dashboard...................................................................................1020
The URL/XSLT View.............................................................................................................................1023
URL/XSLT Properties.....................................................................................................................1023
Add a URL Link to Display the Customer Website.................................................................1023
The Process Link.................................................................................................................................1026
Process Link Properties.................................................................................................................1026
Add a Process Link for Customer Entry.................................................................................1026
The Report View and Report Link........................................................................................................1030
Report Options............................................................................................................................1030
Design Crystal Report..................................................................................................................1031
Select Report Data.......................................................................................................................1035
Add Report View.........................................................................................................................1042
Add a Report Link to the Dashboard............................................................................................1045
Publish and Subscribe Functionality............................................................................................................1049
Add a Secondary Query to Display Line Item Shipment Information.....................................................1049
Publish................................................................................................................................................1051
Publish Fields from a Query..........................................................................................................1052
Subscribe............................................................................................................................................1053
Apply a Filter that Subscribes to the Published Order and Line Number........................................1053
Bind Query Parameter to a Published Column.....................................................................................1056
The Dashboard Browse..............................................................................................................................1061
Add a Dashboard Browse to the Dashboard........................................................................................1061
Dashboard User Notes and Tech Notes.......................................................................................................1068
Update Notes.....................................................................................................................................1069
Dashboard Properties.................................................................................................................................1070
Modify the Dashboard Title Bar...........................................................................................................1071
Enable the Dashboard as Advanced Search.........................................................................................1073
Dashboard Modification.............................................................................................................................1075
Copy a Dashboard..............................................................................................................................1075
Multi Threaded Save..................................................................................................................................1078
Reusing Views............................................................................................................................................1081
14 10.2.700
Epicor ICE 3.2 Tools User Guide Contents
Deploy Dashboards....................................................................................................................................1095
Deploy Dashboard as an Application...................................................................................................1095
Access New Dashboard.......................................................................................................................1100
Deploy Kinetic Dashboards.........................................................................................................................1105
Deploy Dashboard as a Kinetic Application.........................................................................................1105
Add Kinetic Dashboard to the Main Menu..........................................................................................1108
Mobile Device Dashboards.........................................................................................................................1111
Assign Mobile Access Rights...............................................................................................................1111
Create a Mobile Device Dashboard.....................................................................................................1112
Define Mobile Navigation...................................................................................................................1115
Deploy Mobile Dashboard Device........................................................................................................1120
Mobile Menu Maintenance.................................................................................................................1123
Explore Home Page.............................................................................................................................1124
Launch Mobile Dashboard..................................................................................................................1126
Filter Data...........................................................................................................................................1127
Update Records Using Mobile Dashboard...........................................................................................1131
URL Query Phrase Subscribers....................................................................................................................1134
Create New Dashboard.......................................................................................................................1135
Create URL View.................................................................................................................................1137
Epicor SharePoint Publisher........................................................................................................................1140
Create a New Web Part Page..............................................................................................................1141
Modify a Web Page............................................................................................................................1143
Arrange Views Within the SharePoint Page.........................................................................................1147
Adjust the ESP Dashboard...................................................................................................................1149
Web Dasher........................................................................................................................................1152
10.2.700 15
Contents Epicor ICE 3.2 Tools User Guide
16 10.2.700
Epicor ICE 3.2 Tools User Guide Contents
Example Two...............................................................................................................................1258
Create a Dimension BAQ....................................................................................................................1259
Build the Executive Query Against Data Dimensions.....................................................................1265
Schedule a Process Set........................................................................................................................1267
Create BAQs for Executive Dashboard Display.....................................................................................1268
Dimension BAQ...........................................................................................................................1268
Dimension Details BAQ................................................................................................................1269
Data BAQ....................................................................................................................................1270
Create and Deploy a Dashboard.........................................................................................................1271
Verify the Process Set..........................................................................................................................1272
10.2.700 17
Contents Epicor ICE 3.2 Tools User Guide
18 10.2.700
Epicor ICE 3.2 Tools User Guide Introduction |
Introduction
The Epicor Tools User Guide explores the data gathering and monitoring tools available within the Epicor ICE
framework. This guide is intended for managers responsible for fine-tuning their departmental use of the Epicor
ERP application and advanced users looking to manage and display key data for their specific business needs.
The first chapters examine business activity queries, or BAQs, which are the primary query tools you use for
pulling, displaying, and entering specific data. You can create BAQs that display unique views of data, and also
updatable BAQs that contain fields you activate for data entry. Next you explore how to use the External Query
functionality to manipulate data from external data sources. Then the BAQ Report Designer chapter explains how
to turn a BAQ into a SQL Server Reporting Services (SSRS) report.
The Searches chapter that follows explores the tools you can use to easily locate and organize records using filters
and specific criteria.
The chapters that follow discuss the Business Process Management (BPM) functionality you can use to create
workflows that automate, execute and monitor business processes. Learn how to create method, data, and BAQ
directives that ensure data entries are valid and reflect your business cycle. The Custom Business Process
Management chapter discusses more advanced techniques such as execution of custom code written in C#
language or creation of external methods. The BPM functionality is concluded with an overview of utilities available
within the BPM module.
Then, the Global Alerts chapter explores how you can use both standard and custom global alert messaging.
Global alerts are email messages you activate to help specific users track data activity. Learn how to determine
which alerts you want continuously monitoring data and who will receive the automatic email messages generated
by the specific database activity.
The chapters that follow explore how to monitor, display and manipulate your business data using Dashboards.
Learn how to incorporate BAQs and BPMs for custom use on smart client dashboards, executive dashboards,
and mobile device dashboards.
The guide concludes with the Epicor Data Analytics (EDA) chapter. You can use this business analytics tool for
long-term data exploration in a data warehouse.
Use this guide as a starting point to learn about the available data flow tools and as a reference for later use of
these same tools. This guide is a crucial resource for anyone who monitors data to both manage and enhance
their organization’s unique business practices.
10.2.700 19
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Use the Business Activity Query (BAQ) Designer to create personalized queries or to copy system queries so you can
modify them. Queries can be accessed in different ways throughout the Epicor ERP application. Queries can be used
to generate Reports, included in application Searches, displayed and updated through a dashboard and mobile devices.
BAQ execution results can also be exported as .xml or ASCII files, so you can edit their data in third party applications
as well. The functionality has some security options, as you can create queries only available for your personal use, or
create shared queries available to everyone within your company.
Leveraging this functionality does require some fundamental knowledge of database concepts such as table relationships,
records, and field types. This knowledge helps you create queries that have good performance and display the results
you want. You start by defining the information to display through your BAQ, and then finding out which database
tables contain the appropriate columns which hold this data. Some application tools are available which can help you
find the database information you need. This chapter describes these tools.
Once you determine the information you want to display, you can begin creating the query through the Business
Activity Query Designer. Use the Query Builder sheets to define which tables you want to include in your main query,
potential subqueries and what relationship they have with each other. You also define subquery parameters and decide
which columns you want to display for the end user. Finalize your BAQ by testing it using the Analyze sheet, correct
any errors before you use this query on a dashboard or mobile device.
Queries can be read only tools which you can later place on a smart client dashboard for display on the Main Menu.
You can also create an updatable BAQ. These BAQs can be placed on a smart client dashboard and/or used on a mobile
device, such as an iPhone® or a Blackberry®. Users then enter data through either the dashboard or the mobile device,
and this new data updates records within the main database. Business Process Management (BPM) directives can be
created which monitor the data entered through an updatable BAQ. Based on the conditions defined in the BPM
directive, various actions run automatically. For example, you could use this functionality to verify data is being correctly
entered into the database. Updatable dashboards and BAQ directives are described in later chapters in this guide, but
you will learn the basic principles for updatable BAQ functionality through this chapter.
To further leverage the BAQ functionality, you can connect to an external data source using the ODBC connection.
Use this feature to design an external query in a similar way to create an ordinary query. For more information on how
to utilize External BAQs, review the External Business Activity Queries chapter.
The Epicor application contains tools to help you locate database information you need. These tools also reduce
issues with your BAQs, as you can leverage them to make sure you reference correct fields and tables within your
modified and personalized queries. This section describes Data Dictionary Viewer and Field Help options you can
use to find the required information before you start designing your custom query.
20 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
You 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 every field.
Use this program to identify the fields and tables you want within a custom business activity query. This program
is also an aid during upgrades, as you can view the current database structure to compare it against a previous
database version; this helps to ensure your BAQs match the current state of the database.
Menu Path: System Setup > System Maintenance > Data Dictionary Viewer
Table View
1. In the Table Schema Type, select a schema that holds the table of your interest.
The available options include:
• System - Select this option to retrieve tables belonging to the ICE schema which refers to the Tools
(framework) part of the system.
• Product - Select this option to retrieve tables belonging to the ERP schema which refers to the Application
part of the system.
• Intermediate - Select this option to retrieve intermediate tables. Tables within this schema stage the
data for another process to come through and update the main database tables.
10.2.700 21
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Click the Table button to find and select the table you wish to review.
4. The IndexName column displays the index name used by the database to access a specific field. Each field
is displayed using its database schema name. In this example, ABCldx is shown.
5. The Fields displays which column(s) of a database table are associated with a particular index as well as the
order in which columns are listed in the index definition.
6. The Display Format section contains options that change how the information displays on the Tree View.
Available options:
• Schema – Select this option to display the table fields in schematic order on the Tree View. This defines
the order of precedence in which the fields are evaluated by the application. For example, Company,
Resource Group, Alternate Resource Group.
• Alphabetic – Select this option to display the table fields in alphabetic order on the Tree View. For
example, Alternate Resource Group, Company, Resource Group.
Field View
You can also use the Data Dictionary Viewer to display information on a selected field.
1. In the Tree View, select a field. In this example, you select the Count Frequency field.
22 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. The Field Name displays the selected field. If you need, you can use the Navigation toolbar to display a
different field.
4. The Format field defines the layout for the characters within the field. This value displays in either schema
or alphanumeric format; for example, X(8), >>9.
5. If this field is a Decimal type (see the Type field description below), the Decimals field displays how many
decimal positions are available within the field.
6. The Extent field indicates how many items you can store within this field for each record. If this value is
higher than one, it indicates multiple values can appear within this field. For example, if 5 displays, the field
can contain up to five items.
7. The Type field defines the selected field’s main data definition. The type defines the data that displays within
the field; for example, nvarchar, integer, bit.
8. The Initial Value field defines the beginning value, if any, that automatically displays within this field. It
indicates the default value that appears each time a user views this field.
9. If this field is displayed on a grid, the Column Label field indicates the text that displays at the top of the
grid column; for example, Count Freq.
10. The Label field displays the title that displays above the field on a sheet, for example, Count Frequency.
10.2.700 23
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. When selected, the Mandatory check box indicates the current field is required. To finish a record within
this table, users must either enter data or select an option within this field.
12. The Description field displays the concise explanation for the field. This text explains the field’s purpose
and other useful information.
13. The Display Format section contains options that change how the selected field’s information displays on
the Fields sheet. Here is what these options do:
• Schema – When selected, this option displays the field’s schematic values. These values define how the
database views and evaluates this field’s data.
• Alphabetic – When selected, this option displays the field’s alphanumeric values. Use these values to
help you understand how the field’s data appears on the interface.
Field Help
Use the Field Help feature to display the technical details on a specific field within a program (form). With the
Field Help window displayed, you can immediately see the technical information you need on each field. When
you click the mouse pointer inside a field, the Field Help window displays the field details from the Data Dictionary.
Navigate and launch the program that contains fields you want to use in a BAQ to activate field help within each
program.
For this example, you launch Ship Via Maintenance: Sales Management > Order Management > Setup >
Ship Via.
2. From the menu options, select Field Help to display the pane in the left portion of the screen.
24 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. Click the Thumbtack icon to pin the window in place. If you do not click this icon, the Field Help window
automatically minimizes to the side of the window (form). You can then display Field Help again by clicking
the button that displays on the side of the window.
4. When the Field Help window is pinned to the interface, you can view the technical details for the current
field. To do this, click the Technical Details button.
5. The Field Help window displays the technical details on each selected field. For this example, the Description
field is selected on the Detail sheet, and so the technical details for this field display within the Field Help
window.
10.2.700 25
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. The EpiBinding field displays the name to use if you want to link to this field through a customization or
a code reference. This value uses the ViewName.FieldName format. ViewName is the name of the view on
the user interface; FieldName is the database column name.
8. The DB Field value contains the information you most likely need for your BAQ. It displays the table name
and the column name for the selected field. Typically, this value is identical to the EpiBinding value and it
displays the true database name for the field.
9. The Format field defines the layout for the characters within the field. This value displays in either schema
or alphanumeric format; for example, X(30).
10. If this field is a Decimal type, the Decimals field displays how many decimal positions are available within
the field.
11. The Data Type field defines the selected field’s main data definition. The type defines the data that appears
within the field; for example; Character, Decimal, Boolean (True or False).
12. If this field is displayed on a grid, the Column Label field indicates the text that appears at the top of the
grid column.
26 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
13. The Description field displays the concise explanation for the field. This text explains the field’s purpose
and other useful information.
14. Continue to click other fields to display the technical details for each field on the form. When you finish,
click Close on the Field Help toolbar.
System Queries
Several system queries developed by Epicor are installed within the application. The delivered queries all begin
with the letter ‘z’ so that you can easily differentiate them from queries you create. When you create a custom
query, or copy an existing query to modify it, you must follow specific naming conventions.
Navigate to Business Activity Query Designer.
Menu Path: Executive Analysis > Business Activity Management > Setup > Business Activity Query
2. Notice you can filter the business activity queries by various types. To view system queries, select the
System check box.
10.2.700 27
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. Click Search.
5. The Author field displays the login of the user who created the BAQ. Only the author can modify their
BAQs. However, you can assign a new author to modify a BAQ. To do this, from the Actions menu, select
Change Author. This functionality is explored in the Actions Menu section of this chapter.
7. The Shared property indicates whether a query is available to all users within the current company. System
queries are all marked as Shared.
8. The Cross-Company check box indicates the ability of a query to brings back all results across companies.
In order to use this function, a selected user must have the ability to create cross-company queries.
9. If a query is Updatable, a check mark displays in this column as well. This value indicates users can enter
data within the BAQ that then updates the database.
10. The External queries use data retrieved from an external datasource outside the Epicor ERP application.
They are created within the External Business Activity Designer found in the System Management module.
To learn more about this functionality, review the External Business Activity Queries chapter.
28 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
11. As you indicated in the Search criteria, only System queries display on the list.
All system queries are created by Epicor, and this column indicates Epicor delivered these BAQs to your
database.
12. The All Companies check box indicates whether the BAQ Definition is visible to all companies on the same
database server. When the Epicor application uses multiple companies contained within a single database,
the BAQ usage and visibility is applied regardless of multi-company direct configuration. For companies
hosted on different databases, this check box initiates the Service Bus processing, when it is configured to
synchronize BAQs to external companies. If the custom BAQ is created from a Company that is running
under a multi-tenant license, the definition becomes visible to all companies within the same Tenancy as
the Owning Company. The BAQ definition can only be updated from the original company, but is available
for execution and review in other companies.
13. The Use Primary Database field indicates if this execution setting is enabled for the BAQ.
For details on the Use Primary Database feature, please refer to the Actions Menu > Execution Settings
topic.
14. Select the system query you need and click OK.
15. The Change Security Code command allows selecting custom Security codes and apply them to System
BAQs. If a seeded System BAQ already references a System Security code as assigned by Epicor, it is possible
for customer administrator to control user access by creating a custom Security code record and allow or
disallow access to users or user groups, and assign them to System BAQs. In On-Premise and Multi-Tenant
environments a user can apply one Security code to any System BAQ. The applied Security code allows user
access to a system query in all on-premise companies, as well as in all companies within the tenancy.
10.2.700 29
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Custom Queries
You create your own queries in the Business Activity Query (BAQ) Designer program.
When you create custom queries, make sure you query database tables that are indexed in the Epicor Data Model.
The Epicor database contains a number of internal system tables that are not part of zData. When run from the
ERP application, queries that request data from such tables end up in failure. Use the Data Dictionary Viewer tool
to check if a specific table belongs to the Epicor Data Model.
Furthermore, the BAQ Designer also takes into account additional table metadata stored in the Epicor Data Model
- for example, detailed description, data format, Like columns from other tables, or applied security restrictions
(by Territory ID, Site/Plant, etc.). So if a table has been designed to display only for one specific site, you will not
be able to query it from another.
Some table fields and tables may have availability restrictions based on their pertinence to a specific
Country/Country Group Code (CGC Code) used in development of Country Specific Functionality (CSF). In the
BAQ Designer, you can query such fields or tables only from the Companies with a matching Country Code or
Country Group Code, if any. For example, the Erp.Customer.MXMunicipio field is available for querying only if
you have the Mexican CSF package installed and the current Company has the MX (Mexico) Country Code
assigned to it.
The Business Activity Query Designer program contains multiple sheets through which you define the query
criteria and indicate how the data displays through the executed query. The content and purpose of each sheet
is described in this section.
Use the General sheet to create your query; you define the query’s identifier and description here. You also
indicate whether this query should be made available to all users within the company, support data updatability,
if you want to share this query between multiple companies and if the query should retrieve results across
companies.
In this example, you create a query that displays all open sales order detail lines.
The QueryPhrase text box displays the query you created. The resulting SQL statement is a pseudo SQL statement
that indicates how the query is executed.
30 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. In the Description field, enter a concise explanation for the query. In this example, enter Total Value of
Quotes, Orders, Invoices by Date.
4. Notice the Author field displays the name of the user who created the current business activity query. Other
users cannot modify the current query. If you need to assign author rights to another user, use the Actions
> Change Author option.
5. The Owning Company displays the company inside which the current BAQ was created. You cannot change
this value; only users within the Owning Company can modify this BAQ.
If the All Companies check box is selected, then companies within the same organization as the Owning
Company can view and use the query. If the System BAQ check box is selected, the Owning Company field
is blank. This indicates the current BAQ is available to all companies within the current organization.
6. The Shared check box indicates this query is available to all users. After you save the query, all users in your
company can utilize this query using the available BAQ consumers, such as Quick Searches, BAQ info zones,
BAQ reports, and dashboards. Note these users will need various rights to use these features.
7. The All Companies check box controls whether the current BAQ Definition is visible to all companies on
the same database server. When the Epicor application uses multiple companies contained within a single
database, the BAQ usage and visibility is applied regardless of multi-company direct configuration. For
companies hosted on different databases, this check box initiates the Service Bus processing, when it is
configured to synchronize BAQs to external companies.
10.2.700 31
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
If the custom BAQ is created from a Company that is running under a multi-tenant license, the definition
becomes visible to all companies within the same Tenancy as the Owning Company.
The options/values for tenant and multi-tenant features are only for Epicor hosted environments. Typically
you can ignore these options. Internal Epicor administrators who need more information should refer to
the Epicor SaaS Installation Guide.
To see in which companies (outside the current company), references to the BAQ were created, use the
Where Used tabs.
8. The System BAQ check box indicates whether the current BAQ is installed with the Epicor ERP application.
If the current BAQ is a system BAQ, you cannot make changes to it.
This information displays in the read-only format.
9. By selecting the Updatable check box, you indicate the current query allows performing database updates.
This option activates the sheets under the Update tab; use these sheets to indicate which fields will be
available for data entry through this query. You can place an updatable BAQ on both smart client dashboards
and mobile device dashboards.
To learn how to utilize updatable queries, see the Updatable Business Activity Query section later in this
chapter.
10. The Cross-company check box controls if the BAQ brings back results across multiple companies.
In order to use this function, a selected user must have the ability to create cross-company queries.
11. Click the Security ID button to search for and select a security code used to give or block access to the
BAQ for specific users. Security codes limit access to user groups, specific users, and/or both; the codes are
configured in the Menu Maintenance program.
32 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Use the Query Builder sheets to design a Business Activity Query. Use this sheet to set up everything from basic
queries with a single table to complex queries including multiple subqueries of different types, joins or query
parameters.
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.
Several 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.
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 and indicate
if you want to sort BAQ results through any combination of columns.
The SubQuery Options sheet is where define subquery properties. 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 the read-only information of all subqueries created within the BAQ. All
subqueries are ordered by the sequence number. Using this sheet, you can change the order of subqueries to
define how partial query texts are concatenated in the final SQL statement.
Add Table
Use the Phrase Build sheet to design a query using the visual representation of the query.
1. On the left pane, Epicor ERP tables, Extension tables within the database are displayed in the table palette.
Select a table you want to add.
10.2.700 33
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. To easily locate the table you want, in the Filtering field, enter a value.
By default, the filter is applied to all tables whose names (excluding the schema part of the table name) start
with the string you enter in the filtering box. In this example, enter Quote to narrow down the list of tables.
3. When you select the Contains check box, all tables that contain a filtering substring you enter in the Filtering
field display.
4. In the left pane, above the list of tables, the three buttons control the list of available objects you can select
and drag on the designer canvas:
• Connected Only - When selected, the palette displays only the tables that have relations, described in
system tables, with the table you select on the canvas. The table palette displays Extension Table when
connection with selected table is defined in Extension Table settings.
• SubQueries - When selected, the palette displays subqueries of InnerSubQuery or CTE type created
within the current BAQ. You can drag these subqueries on the canvas and use in the JOIN clause as any
ordinary table.
• Table-Valued Functions - When selected, the palette displays all Table-Valued Function (TVF) defined
in the application. A Table-Valued Function is a user-defined function that returns a table. Currently, this
feature is only supported in External Business Activity Query.
5. The central part of the form contains the canvas where tables are dropped.
34 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. To include a table in your query, select a table and drag it on the canvas in the center pane.
Additional Controls
Several additional Phrase Build controls help you construct the query.
1. To create a manual connection between two tables, click the Add Connection button. Select the first table
you want to link; drag the line and drop it on the table you want to connect to.
For more information on table connections, review the Phrase Build > Table Relations topic.
10.2.700 35
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. If you want to remove a table or an existing connection from the query, select it on the canvas and click
Remove Selected.
3. Instead of selecting tables individually, you can use the Business Objects button to search for and load
table(s) within an entity, for example, ERP.Part. These tables are organized as hierarchical nodes under the
business objects, User can inspect these tables and drag some of them on the canvas. Dragging the parent
node results into adding all child nodes also. The links between loaded tables are displayed automatically.
4. The Toggle IsSummary Flag button is an Epicor 9 legacy feature, which should be used ONLY with legacy,
migrated BAQs to simulate Epicor 9 summary table behavior. Users should not use this option when creating
new BAQs as this flag does not support new features such as subqueries. New BAQs should use standard
SQL syntax with GROUP BY and HAVING, and SQL aggregate functions to create aggregate queries.
5. You can use the options on the Arrange Diagram list to modify how the tables display on the grid. Available
options include:
• Diagram Overview - Displays the query in its default view mode.
• Zoom - Select this option to turn on zoom mode. When you click the tables in the grid, they increase
in size.
• Fit to Screen - Displays the entire query through a high level view.
• Layout Tables Automatically - Places the tables in a default order. The order of tables can be set on
the Table List sheet. Current positions of tables within a subquery is represented by numbers in the upper
left corner of table rectangles.
6. The right pane contains the description and list of the columns on the selected table. You can use the
Filtering edit box to only view the columns, with names that start with specified letters and sort column
names (alphabetically or in database order).
Table Relations
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.
By default, queries are set up to display Matching rows from {left joined table} and {right joined table},
which means that data from the first table only displays if it is linked to data within the second table. The query
output from this type of 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.
For example, use the matching rows 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.
You can use the following join types to retrieve the expected BAQ results:
• Matching rows from {left joined table} and {right joined table} - only rows satisfying join criteria from
both joined tables are selected. By default, tables are linked through this type of join.
36 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Example
The join between the Customer table1 and the OrderDtl
table2 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.
• All Rows from {left joined table} - rows satisfying join criteria from both joined tables are selected as well
as all remaining rows from left joined table are kept along with Nulls instead of actual right joined table values.
Example
Use the All Rows from {left joined table} join to view all
customers (table1) and the orders (table2) 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.
• All Rows from {right joined table} - rows satisfying join criteria from both joined tables are selected as
well as all remaining rows from right joined table are kept along with Nulls instead of actual left joined table
values
10.2.700 37
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Example
Use the All Rows from {right joined table} join to find each
employee (table1) and his or her department (table2), but
still show departments that have no employees.
• All Rows from {left joined table} and {right joined table} - rows satisfying join criteria from both joined
tables are selected as well as all remaining rows both from left joined table and right joined table are kept
along with Nulls instead of values from other table.
In SQL, this type of 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.
When two tables are placed on the canvas, and relation between tables is described in the dictionary, the relation
is drawn by the BAQ automatically. The relation is represented by the line that indicates the JOIN clause. You
can also create table relations manually or replace existing ones.
To automatically connect tables:
1. Click the Connected Only button (the chain link icon) to only display tables appropriate for linking with
the selected table that displays on the grid.
38 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. Click and drag another table to the grid. In this example, drag and drop the Customer table on the center
pane.
3. When two tables are placed on the canvas, and relation between tables is described in the dictionary, the
relation is drawn by the BAQ automatically. The relation is represented by the line that indicates the JOIN
clause. Automatic creation of JOINs is supported between standard Epicor tables, between Epicor tables
and Extension tables, and between Extension tables.
4. When the relation involves two standard tables, by default queries are set up to display the Matching rows
from {left joined table} and {right joined table} join type, which means that data from the first table
only displays if it is linked to data within the second table. The query output from a Matching rows 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. When relation
is between Standard and Extension tables, by default it is set up to display the All Rows from {left joined
table} join type, which means that join criteria includes all rows from Standard table, while only including
matching rows from Extension table. Data on relations between two tables is selected from Extension Table
settings. When relation includes two Extension tables, by default it is set to include all rows from the parent
table, and only matching rows from the child table.
The available types of joins are discussed on the Phrase Build - Table Relations topic.
5. You can use the Dictionary button to view and select one of the predefined relations between tables. This
is supported for relation between Standard tables, between Standard and Extension tables, and between
two Extension tables. When two tables are placed on the canvas, and relation between tables is described
in the dictionary, the relation is automatically defined by the BAQ.
10.2.700 39
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
As tables are placed on the canvas subsequently, the newly added table always 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.
6. The Table Relations from Dictionary window that displays when you click the button lists all relations
with their fields. The result relation expression displays in the Expression text box at the bottom. You can
select one of the relations and press the Replace In Query button. As a result, fields from the Dictionary
form will replace fields used in the current BAQ relation.
7. In this example, accept the default relation between tables using the Company and CustNum columns.
40 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
If you want to join tables or subqueries with no predefined relations in the system, you must manually create
these relations. You can also replace or modify existing relations by building an expression of your choice.
To manually create a relation between tables:
1. To create a join between tables or subqueries, click the Add Connection button.
The cursor turns into the cross.
10.2.700 41
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Create a join between tables using the drag and drop functionality.
The tables are connected with the line. In this example, 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.
3. At the bottom of the screen, the Table Relations sheet is automatically selected.
42 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. To define the relation between the tables, on the Table Relations sheet toolbar, click the Add Row button.
5. Create a join between the first and second table. In this example, you select the Company column to join
Part and Company tables.
6. If the BAQ designer determines a non-standard expression, it displays the Fx symbol in the middle of the
join square on the link.
10.2.700 43
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. In the Join Type field, select a desired type of join to combine records from two tables to construct your
query. The available types of joins are discussed in the Phrase Build - Table Relations topic.
When tables you add are not joined by any field, the
CROSS JOIN (Cartesian join) is automatically selected.
This join returns all records where each row from the first
table is combined with each row from the second table.
Table List
The Tables List sheet displays the list of tables and subqueries you place on the canvas for the subquery in focus.
The first table listed in the FROM clause of the resulting SQL statement is explicitly set on this sheet. The order
of the other tables is based on table relations.
1. If your BAQ incorporates multiple SubQueries, switch between them using the Active SubQuery navigational
toolbar found above the Phrase Build sheet.
44 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. The current position of a table within a subquery is represented by a number in the upper left corner within
the table rectangle.
3. In this example, the QuoteHed table is the first table within the table order.
5. To change the order of tables, select a table and use the Up or Down arrow on the toolbar to move the
selected table one position up or down. Repeat this action the required number of times to move the table
several positions up or down to define the new table order. In this example, select the Customer table and
click the Up arrow to make it the first table on the list.
10.2.700 45
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Table Criteria
Use the Table Criteria sheet to limit the data that displays in the BAQ results by adding filtering conditions for
the selected table.
When you add a filter to the table, the following rules apply:
• If the table with applied filtering is the first table in the BAQ, then these criteria go to the WHERE part of the
resulting SQL statement.
46 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
• If the table with applied filtering is not the first table in the BAQ and is connected to the previous table with
join, then within the resulting SQL statement, these criteria will be applied to the JOIN clause in the ON
condition.
You should consider leaving the query criteria open. You then
have more flexibility within the query, as you can always add
a filter to the query results within a dashboard or a BAQ report.
For more information on this functionality, review the BAQ
Report Designer and Dashboards chapters.
1. Select a table on the canvas from which you want to filter the data. In this example, select the QuoteHed
table. Notice the table with a filter applied displays the "+criteria" indicator on the table rectangle.
2. Click the Sort Columns Alphabetically button to display the fields on the drop-down lists in alphabetical
order.
4. A new row displays on the grid; enter the options you need for this filter. In this example, you add a filter
that causes the query to only display quotes that are currently active.
5. The And/Or field defines the criterion string clause in relation with other criterion on this sheet. Use this
field when you need to apply a filter based on the values of more than one criterion.
10.2.700 47
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. Use the ( and ) fields to insert the left and right parenthesis to the clause. You can enter as many parenthesis
characters as you need to complete the order in which you want the criteria to filter the results.
7. If you want this criterion to evaluate a Not criterion value, select the Not check box. This Not value indicates
you want a value returned not like the evaluating value; for example, a column NOT IsNull.
8. From the Field drop-down list of fields of the table selected on the canvas, select the QuoteClosed field.
9. The Compare (operator) list defines how the selected field is evaluated against the Filter Value. In this
example, select = (equals) option. The Filter Value can be an alphanumeric value. You have the following
options:
Operator Description
> Greater than
< Less than
= Equals
>= Greater than or equals
<= Less than or equals
<> Not equal or not identical to
BEGINS Returns data that starts with the same characters. Although this operator is less efficient
compared to the Greater than or Equal sign (>=), you can use this value to pull in a series
of records that start with the same set of alphanumeric characters.
MATCHES Returns data that is exactly the same as the character string. Although this operator is less
efficient compared to the Equal sign (=), you can use asterisk wildcards to pull in data. For
example: MATCHES '*owe*' finds both owe and powerful. With MATCHES, you can use
no asterisks, a left asterisk, a right asterisk or both asterisks.
• 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.
IN Indicates this value is used with either a list of constant values or a BAQ item list parameter,
or a field from an inner subquery.
You can also use this criterion for updatable BAQs.
48 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Operator Description
CONTAINS Returns data when the selected character field has data which is present within the defined
Filter Value.
Msg 7601, Level 16, State 2, Line 1 Cannot use a CONTAINS or FRE
ETEXT predicate on table or indexed view 'Erp.Abccode' because i
t is not full-text indexed.
This field is a predicate used in a WHERE clause to search columns containing character-based
data types for precise or fuzzy (less precise) matches to single words and phrases, the
proximity of words within a certain distance of one another, or weighted matches. This
operation can be applied against column of following data types and its derived types:
• char
• text
• image
• xml
• binary
EXISTS The EXISTS condition is considered to be met if the SubQuery returns at least one row. This
condition can be used in any valid SELECT SQL statement. The syntax for the EXISTS condition
is:
SELECT columns
FROM tables
WHERE EXISTS ( subquery );
LIKE Allows usage of SQL Like syntax. It determines whether a specific character string matches
a specified pattern defined in the filtering value. A pattern can include regular characters
and wildcard characters.
10. Click the Filter Value drop-down list to define how this criterion filters data. Each option displays with
hyperlink text; click this hyperlink text to define the filter values. The next section describes each of these
options in more detail. In this example, select the specified constant option. Click the specified link.
10.2.700 49
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
12. In the Value field, enter the constant value you need. In this example, enter False as you want the query to
return open quotes.
14. Notice the word False now displays as the filter value.
15. Continue to add the criteria you need. When you finish, click Save.
16. You can now view your query; navigate to the General sheet.
17. The Query Phrase text box displays the query you created. Notice your criterion is included as part of the
resulting SQL syntax.
50 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
SubQuery Criteria
Use the SubQuery Criteria sheet to narrow down BAQ results by adding filtering conditions on the selected
SubQuery.
When you add a filter to the SubQuery, the following rules apply:
• In the resulting SQL statement, the SubQuery criterion displays in the WHERE part of the SubQuery.
• When you select the Having check box to indicate the SubQuery should meet specified conditions, the criterion
displays within the SubQuery's HAVING part of the resulting SQL statement.
For more information on creation of SubQueries, read the SubQuery Options topics.
1. If your BAQ incorporates multiple SubQueries, switch between them using the Active SubQuery navigational
toolbar found above the Phrase Build sheet.
10.2.700 51
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. A new row displays in the SubQuery Criteria grid; enter the options you need for this filter. In this example,
the BAQ is comprised of two SubQueries returning the list of Quotes and Orders. You will limit the BAQ
results by adding a filter to each SubQuery. For the Quotes SubQuery, add a criterion to only return quotes
for the customer Addison.
5. Entering a condition for the SubQuery is similar to entering Table Criteria discussed in the previous topic,
except in a SubQuery, first use the Table field to select a table from the current SubQuery or a predefined
Calculated table name, when referring to calculated fields. In this example, select the Customer table.
6. Build the criterion by selecting the SubQuery Field, Operation and Filtering Value. In this example, create
a criterion to only retrieve quotes from the customer Addison.
7. When you select the Having check box, the SQL statement returns rows where aggregate values meet the
specified conditions. Typically you use this field with the calculated field editor.
8. If you want to apply criteria to another SubQuery, use the Active SubQuery navigational toolbar to select
it.
52 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
9. Enter the criteria for the second SubQuery. In this example, limit the BAQ results to only retrieve orders for
the customer Dalton.
10. You can now view your query; navigate to the General sheet.
11. The Query Phrase text box displays the query you created. Notice the filtering is applied to each SubQuery
within the resulting SQL syntax.
10.2.700 53
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
54 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Filter Values
The previous sections described how to create a criterion using the specified constant filter value. This section
now discusses each of the Filter Value options, explaining what you can define on each option.
Use this option to filter the data using a field from a table included in the query.
1. From the Filter Value drop-down list, select the specified table field value option.
10.2.700 55
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. In the Subquery field, select the name of the subquery used to filter data.
5. From the Table drop-down list, select the table that contains the fields you want to filter against. All the
tables available in your current subquery display.
6. All the available fields display in the fields section. Select the field you want to use in the criterion.
7. Click OK.
56 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Specified Constant
Use this option to filter the data against a specific value you define. To use this option, do the following:
1. From the Filter Value drop-down list, select the specified constant option.
4. In the Value field, enter the value you want to filter against. You can enter any text value you need.
Depending on what you enter, some values may or may not be case sensitive.
5. Click OK.
10.2.700 57
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Specified Expression
Use this option to filter the data against a specific expression you create. You can use this filter to build complex
expressions that are calculated when the criterion is applied to the query.
To create an expression:
1. From the Filter Value drop-down list, select the specified expression option.
3. The Specify SQL Expression window displays. To help you create expressions, the Editor window contains
lists of available fields, functions, and operators. You can add these items to an expression by either
double-clicking them or dragging them onto the editor window's Editor field.
58 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
The editor supports intelligent code editing, which includes invoking member lists. To bring up a list of
columns for a table, enter the name of the table followed by a dot (.) and press Ctrl + Space. Select the
column you need, it will be added to the table name. For example, ABCCode.Company.
4. Click OK.
Specified Parameter
Use this option to filter the data using an alternative parameter value you define. These parameters can be nearly
any value you need.
You can also use parameters to display customized method arguments for use in Business Process Management
(BPM) directives.
The query text contains references to arguments using this format: @arg_name
Example
1. From the Filter Value drop-down list, select the specified parameter option.
10.2.700 59
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. Enter the Parameter Name you want for your new parameter value.
This name cannot contain any spaces.
60 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. From the drop-down list, select the Data Type for the parameter. Available types:
• nvarchar
• int
• decimal
• date
• datetime
• bit
• uniqueidentifier
• bigint
6. In the Format field, the default format for this Data Type displays.
If you need, you can edit this value. Be sure the format follows the convention of the database.
7. If this parameter is required in order for the BAQ to pull in query results, select the Mandatory check box.
8. Use the Editor Type drop-down list to select how you will define the parameter values. Available options:
Option Description
Common Editor Activates the Default Value field. Enter a custom text value you need for the
parameter. The field selected on the criterion is then evaluated against this default
value.
Radio Button Set Activates the Values Editor sheet. Use this sheet to define the various radio button
options this parameter will use. The field selected on the criterion is then evaluated
against these multiple options.
10.2.700 61
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Option Description
DropDown List Activates the Data from drop-down list. Use this list to define the source of the
drop-down list options. The field selected on the criterion is then evaluated against
the options contained on the drop-down list.
Item List Use this option the create the list of values this parameter will use. The field selected
on the criterion will then be evaluated against these item list options. For this option,
BAQ execution expects the list of values transmitted in the ExecutionParameter
table, instead of a single value.
This parameter is only used with the IN operation.
9. If you select the Common Editor option from the Editor Type drop-down list, the Default Value field
activates. Enter the default value you want within this field.
10. Select the Skip condition if empty check box when you want the BAQ to ignore this parameter if it returns
a blank, or empty, value. If parameter is not supplied, the BAQ ignores the criterion with this parameter.
For example, in the condition StartDate > @param1, the param1 value returns null. If the Skip condition if
empty check box is selected, the BAQ does not check the criterion specified for the StartDate field.
11. If you select the DropDown List option from the Editor Type drop-down list, the Data from field activates.
Use the options from this drop-down list to indicate the source from which the data on this list populates.
Available options:
Option Description
Custom The Values Editor displays controls for creating a new list of values. Use this functionality
Values to define the various list options this parameter will use. The field selected on the criterion
will then be evaluated against these item list options. Enter the following information:
• Value - Enter the actual value of the parameter that is sent to the query.
• Display text - Enter the text displayed for the user for this value.
• Order - Defines the sequential order of items in the list.
BAQ The Values Editor displays controls for selecting a BAQ. Enter the following information:
• Query ID - search for and select the BAQ you need.
• Display Column - select the column that displays in the lookup list.
• Value Column - defines the name of the column you want to use for the parameter
value.
62 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Option Description
User Codes The Values Editor displays the control for selecting a specific user code.
User codes are lists of custom values you define through User Defined Codes
Maintenance. When you select a user code, its list of values is compared against the
field selected on the criterion. For more information about creating user codes, review
the User Defined Codes Maintenance help topics.
14. Your new parameter displays in the Select Parameter window. Highlight the parameter you created.
17. You can also create parameters through the Actions menu. To do this, from the Actions menu, select
Define Parameters.
10.2.700 63
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Use this option to filter against a specific constant, like CurrentCompany, CurrentEmployeeID, First Day of the
Month, Fiscal Period, and so on. The query pulls data based on the BAQ constant you select.
To define a BAQ special constant:
1. From the Filter Value drop-down list, select the BAQ special constant option.
64 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. In the Select BAQ Constant window, select one of the constant options available from the list.
4. Click OK.
Use this option to filter query results by date intervals: days, weeks, months, and years. The result is always
evaluated against the current company date (TODAY). You can enter a positive or negative value; the value is
then added or subtracted from the current company date to calculate a different date.
To filter query results by a date interval:
1. From the Filter Value drop-down list, select the Current date + specified interval option.
10.2.700 65
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. Use the arrow buttons and the drop-down list to define the next BAQ execution date.
4. Click OK.
5. The interval in days you defined displays in the Filter Value column. The query pulls in records that have a
date equal to or greater than the interval you defined ahead from the current company date. In this example,
the query pulls in records that have a date equal to or greater than five days ahead from the current company
date.
66 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Use this option to filter the data using values of a subquery field(s) you define.
1. From the Filter Value drop-down list, select the selected value(s) or field from specified subquery option.
4. In the Select SubQuery Field window, the list of subqueries of the InnerSubQuery or CTE type displays.
10.2.700 67
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. Click OK.
8. The subquery field you defined displays in the Filter Value column.
For certain operations, only specific filters are available for use.
The table below displays which filters become available when you select the following operations:
68 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
EXISTS operation
• a row in specified subquery
Use this option to filter the data using a subquery you define. You can select a subquery
of the InnerSubQuery or CTE type.
This operator only checks the row is returned.
If the subquery is not specified for EXISTS condition, the QueryPhrase text box displays
where (exists<not selected subquery>) statement.
When you select the EXISTS operator, in the Filter Value field, you can only select the
a row in specified subquery option.
CONTAINS
• specified contains expression
operation
Use this filter to launch the Specify Expression window. Use this form to create an
expression compatible with the CONTAINS predicate in SQL. Supported terms: AND
(&), OR (|), wildcard (*), parentheses (()). Full-text indexed column is required.
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. To view the list of TVFs available
for use with your product, click the Table Value Function button above the left panel on the Phrase Build
sheet.
TVFs typically require input parameter values. The Function Call Parameters sheet is populated when you add a
TVF to the grid. To be able to retrieve results from the TVF, you must define an expression in the Value field of
each listed parameter. This can be done by manually typing an expression or by using the expression editor that
displays when you click the ellipses button.
10.2.700 69
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
This procedure discusses adding parameter values when adding a Table-Valued Function (TVF) to an External
Business Activity Query (BAQ). You also can select an existing TVF on the grid and edit the parameter values.
To use the TVF function:
5. When you right click on a red TVF rectangle on the canvas, you can use the context menu to set the APPLY
operator.
70 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 71
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
You can use the PIVOT operator within a query to transform data from row-level to columnar data.
PIVOT rotates SubQuery results by turning the unique values from one column in the expression into multiple
columns in the output, and performs aggregations where they are required on any remaining column values that
are wanted in the final output.
Creation of PIVOT statements within a BAQ is available for the InnerSubQuery or CTE SubQuery types. To
activate the Pivot SubQuery FOR Clause sheet, place a SubQuery on the canvas. Right-click the SubQuery
rectangle and select PIVOT > SET PIVOT. To create an aggregation formula used within the PIVOT statement,
click the ellipsis button to invoke the Pivot Aggregate Expression Editor.
In this example, build a query against the OrderHed and Customer tables to determine the number of sales orders
placed by each customer throughout the selected years.
To use the PIVOT operator:
1. Create a BAQ comprised of two SubQueries. In this example, you display the aggregated data through
TopLevel SubQuery1. For the moment, leave this first SubQuery intact.
72 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 73
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
74 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. Now create a calculated column that displays the order creation year.
6. To get the year part of the date on which a sales order was placed, use the datepart(year, expression)
function. The expression looks as follows:
datepart(year,OrderHed.OrderDate)
10.2.700 75
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. Right-click the SubQuery2 rectangle and select PIVOT > Set PIVOT.
9. Notice the word PIVOT displays on the rectangle and the Pivot SubQuery FOR Clause sheet becomes
enabled.
76 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. Click the ellipsis button to invoke the Pivot Aggregate Expression Editor.
11. Use the Pivot Aggregate Expression Editor to create an aggregation formula.
10.2.700 77
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Similarly to the Calculated Field Editor, the window contains lists of available fields, functions, and operators.
You can add these items to an expression by either double-clicking them or dragging them onto the editor
window's Expression Editor field.
Users are not limited to using only the functions from the
tree view. Any function supported by the SQL Server used
by your Epicor application can be used within an
expression. In External BAQs, functions supported in the
database server where the external BAQ is executed
should be used.
12. In this example, count the number of sales orders using the below expression:
count( OrderHed_OrderNum )
13. Now specify the FOR clause of the PIVOT statement. In this example, you define which years you want to
include the pivot table output. To begin with, in the Field column, select the Calculated_OrderYear field
you created. Recall this field returns the year on which each sales order was created.
78 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
14. Now you must evaluate this field against the values you define. In the Filter Value column, select specified
constants list.
16. In the Enter Value List window, create the list of custom values you want to evaluate in the FOR clause.
In this example, define the years you want to analyze.
10.2.700 79
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
17. Using the TopLevel SubQuery1, select the columns you want to include in the BAQ output.
In this example, select Customer_CustID and all fields from the constants list you created in the previous
step.
80 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
18. Now you can test the query. The BAQ output presents aggregated numbers of orders placed by each
customer throughout the selected years.
10.2.700 81
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Display Fields
Use the Display Fields sheet to define the columns that display on your query, how the data is sorted within the
query, and set the display names for the columns. You can also create a special calculated field that you need
within the current BAQ and create advanced data grouping expressions.
The Display Fields sheet consists of two subsheets: Column Select and Sort Order.
Column Select
Use the Column Select sheet to define the columns that display on your query.
You can also configure the display name and format for each column, create a calculation for a selected field
and define how you want to summarize data within the BAQ.
When the SubQuery in focus is of the TopLevel, CTE, or InnerSubQuery type, use the below steps to select
BAQ columns.
To select columns you want to displays in BAQ results:
1. The Available Columns list displays all the tables included within the query.
82 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. To view the columns within each table, expand the table node. In this example, expand the OrderDtl table.
3. The columns available within the OrderDtl table display. Notice each column identifies the type of data it
contains - Y/N (check box), 1.2 (numeric field), abc (character field), and so on.
4. You can click the Sort Columns Alphabetically button to display the columns in alphabetical order.
Typically, you will activate this button, as it makes the fields (columns) easier to find.
5. From the Available Columns list, select the fields you want to display. You can select multiple fields by
holding Ctrl on your keyboard while selecting fields or by holding Shift to select a range of fields.
6. Click the Right Arrow button to move the selected column(s) into the Display Column(s) list. In this
example, select multiple columns from the Available Columns list and move them into the Display Column(s)
list.
7. If you want to modify the column name, enter a value in the Label field. This field displays the default name
for a field. You can edit the display name for the current field. The name you enter displays on the column
header within BAQ results.
10.2.700 83
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. To change the field's format mask, modify the value in the Format field.
Several single character format options are available. Use these options in various combinations to display
the results in the format you want. Available single character formats:
• X - Any Character
• N - Number or Letter
• A - Letter Only
• ! - Lower Case Letter
• 9 - Number Only
• > - Suppress Zeros
Example
• X(8)
• ->>>,>>>,>>9.9999
84 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
9. To group query results by specific column, select the Group By check box.
10. You can remove columns by highlighting them in the Display Columns list.
11. Click the Left Arrow button, or drag and drop the column name to the left pane. The column returns to
the Available Columns list.
12. You can change the order in which the columns display across the BAQ grid. To do this, select a field in the
Display Column(s) List and use the Up and Down Arrow buttons.
10.2.700 85
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
When the SubQuery in focus is of the Union, UnionAll, Intersect, or Except type, use the steps below to select
BAQ columns.
In BAQ Designer, SubQueries are concatenated in the sequential order, so one or more SubQueries of the Union,
UnionAll, Except, or Intercept type can go after TopLevel, or CTE SubQueries.
1. In a SubQuery of the TopLevel or CTE type, define the set of Display Column(s). In this example, SubQuery1
has five columns set for display.
2. On a SubQuery that follows, set one of the Union, UnionAll, Intersect, or Except set operators. In this
example, SubQuery2 of the Union type is used.
86 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. At the bottom, the information on how many fields you need to select to match the number of display
columns in SubQuery1 displays.
5. You are also informed what first column is selected for display in SubQuery1 and what format it uses.
6. From the Available Columns list, select fields that meet criteria described above.
10.2.700 87
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. Use the Right Arrow button to move the fields into the Display Column(s) list.
8. The Alias field displays the field name of the current SubQuery's column.
Field aliases of the result record set are taken from the
first SubQuery.
9. Each SubQuery treats Group By independently. You can construct a BAQ where only one SubQuery
aggregates data, for example:
SELECT Field1, Count(field2)
From Table1
Group By
Group By Field1
UNION
SELECT FieldX, FieldY
FROM Table2
However, if a TopLevel or CTE SubQuery groups data by specific column, and a SubQuery of the Union,
UnionAll, Intersect, or Except type is set up to also aggregate data, the number of columns must match and
column types must be compatible in both the SubQueries. The grouping method used to aggregate BAQ
results can differ in each SubQuery. You can use simple group by in one SubQuery and an advanced grouping
method in another.
In the Display Column(s) grid, all fields, except for Group By, provide read-only information only.
10. The DataType field displays the type of data of the current SubQuery's column.
88 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
11. The Subquery Set Data Type displays the expected data type of the corresponding field from the group's
uppermost SubQuery, which is either the CTE or the TopLevel type.
12. When the expected data type is different from the selected one, the error indicator displays in the
corresponding Subquery Set Data Type column.
13. The Subquery Set Alias field displays the field name of the corresponding field from the uppermost
SubQuery.
In the resulting record set, field aliases are taken from the group's uppermost SubQuery, for example:
CTE Subquery 1
UNION ALL Subquery 2 <-- fields are from Subquery 1
TopLevel Subquery3 <-- new group of Subqueries
INTERSECT Subquery 4 <-- fields are from Subquery 3
In the example above, result fields are taken from Subquery3 – TopLevel Subquery.
14. The Expected Fields box at the bottom displays the following information:
Condition Information
If the number of selected columns in the current The field shows the first NEXT field from the group's
SubQuery is Less than the number of selected uppermost SubQuery, which is expected to be added.
columns in the group's uppermost SubQuery.
Also, the information on how many fields are still to be
added displays.
If the number of selected columns in the current The information on how many fields should be removed
SubQuery Exceeds the number of selected displays.
columns in the group's uppermost SubQuery.
If the number of column in both SubQueries The Check type compatibility message displays.
Equals, and Any Type difference between
When SubQuery fields have different types, the error sign
columns occurs.
displays in the Subquery Set Data Type column.
The error sign does not automatically mean the SubQuery
fails as proper conversion can still be potentially done by
the database server. The intention of the error sign is to
inform the user about the potential data type discrepancy.
When the number of columns Equals in both The Subqueries have equal number of fields message
the SubQueries, and No Type difference is displays.
found.
15. When the BAQ designer logic encounters any errors, they also display in the Analyze Message window.
10.2.700 89
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
16. In this example, the column mapping of SubQuery2 should look as follows.
Use the Calculator button to create user-defined columns based on a calculation of selected fields within the
query.
To help you create valid calculations, the Calculated Field Editor contains lists of fields, functions, and operators.
These default items display in the Tree View where you can navigate and find the item you need. To add an item
to calculation, either double-click it or drag and drop the selected item to the Editor pane.
To create a calculated field:
90 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
1. Navigate to the Display Fields > Column Select sheet and click the Calculation (the calculator icon)
button.
10.2.700 91
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. In the Field Name field, enter the name of the field for which you create the calculation. In this example,
enter OrderCount.
4. From the Data Type list, select the data type generated by this calculation.
In this example, select int.
5. The Format field automatically displays the data format for this calculated field. In this example, ->>,>>>,>>9.
If you need, you can change this value.
6. Enter the Label you want to display above this calculated field’s column header in the BAQ grid. In this
example, enter Total.
7. Now you can start building the calculation logic in the Editor pane.
92 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
The Editor supports intelligent code editing, which includes invoking member lists. To invoke a list of
columns for a table, enter the name of the table followed by a dot (.) and press Ctrl + Space. Select the
column you need, it will be added to the table name. For example, ABCCode.Company.
8. Use the tree view to find and select the Functions, Operators, and BAQ Constants you will use in the
current calculated field. A function calculates a value through specified parameters. An operator is a
mathematical expression used to evaluate a function. BAQ operators and functions are consistent with SQL
naming methodology.
9. First navigate to the function or operator you need. Now either double-click or drag and drop it onto your
calculation within the Editor field. In this example, use the Count function.
10. Use the Fields Tree View to place a specific field within the calculation.
You can use the Fields Tree View to:
• Select any of the current Display Fields and existing Calculated fields you want to add to the calculation.
• Pull in any fields contained within the Available tables included with the current query.
• If you have created parameters to use with the BAQ, these options display under the Parameters node.
Parameters pull in multiple values that you can then use within your calculation. Be aware that parameters
using the Skip condition if empty property cannot be used to create a calculated field and do not
display on the list of available parameters. For information about creating parameters, review the The
Query Builder > SubQuery Criteria > Specified parameter topic.
In this example, expand the OrderHed table and double-click the OrderHed.OrderNum field. The field is
added to your calculation.
10.2.700 93
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. If you need, use the Calculator keys to manually refine your expression.
12. When you complete the calculation, click Check Syntax to verify the calculation logic is valid.
15. Your calculated field is now added to the list of Display Column(s).
16. You can use the Up and Down Arrow buttons to reposition the calculated field as necessary.
Example One
Several calculated fields have been created by Epicor for use in the system queries. The first example is a calculated
field called OpenQty that is used in the zSVSalesOrderBacklog query.
This calculated field determines the Open Quantity of a sales order release by taking the Requested Quantity for
a sales order release, and subtracting the Job Shipped Quantity and the Stock Shipped Quantity. The field is
formatted as a number and displayed as a decimal.
94 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Example Two
The second example is a calculated field called OpenValue that is also used in the zSVSalesOrderBacklog query.
This calculation determines the value of the remaining open balance on a sales order. The calculation uses If,
Then, Else logic written in C# based on the Price Per Code on the Order Detail table. Three different Price Per
Code values are tested in the calculation: M (price per thousand) and C (price per hundred).
The field is formatted as a number and displayed as a decimal.
10.2.700 95
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Functions
The following tables display the functions you can use within the Calculated Field Editor.
Users are not limited to the functions from the Tree View. Any
function supported by the SQL Server used by your Epicor
application can be used within an expression.
For External BAQ functionality, functions supported in the
database server where the external BAQ is executed should be
used.
Aggregate
Aggregate functions perform a calculation on a set of values and return a single value. Aggregate functions are
frequently used with the GROUP BY clause of the SELECT statement.
Function Description
Avg(x) avg(expression)
Calculates the average of all values within the numeric database field.
Count(x) count(expression)
Counts the number of times the database field was counted.
Max(x) max(expression)
Calculates the maximum of all of the values of the numeric database field.
96 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Function Description
Min(x) min(expression)
Calculates the minimum of all of the values of the numeric database field.
Sum(x) sum(expression)
Calculates the total of all the values of the numeric database field.
Math
Mathematical functions execute mathematical operations usually based on input values that are provided as
arguments, and return a numeric value as the result of the operation.
Function Description
Abs(x) abs(expression)
Returns the absolute value of a numeric expression.
Sqrt(x) sqrt(expression)
Returns the square root value of a decimal expression.
Log(x) Log(expression)
Calculates the natural (e) logarithm of a decimal expression.
Log10(x) Log10(expression)
Calculates the base-10 logarithm of a decimal expression.
String
String functions manipulate a string or query information about a string.
10.2.700 97
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Function Description
Asc(x) Asc(expression)
Converts a character expression representing a single character into the
corresponding ASCII value, returned as an integer.
Char(x) Char(expression)
Converts an ASCII integer code to its corresponding character value.
Len(x) Len(expression)
Returns the number of characters in an expression
Left-Trim(x) ltrim(expression)
Removes leading white space from a string expression.
Trim(x) ltrim(rtrim(expression))
Removes leading and trailing white space from a string expression.
Right-Trim(x) trim(expression)
Removes trailing white space from a string expression.
Upper(x) upper(expression)
Converts any lowercase characters in a string expression to upper-case characters.
lower(x) lower(expression )
Converts any upper-case characters in a string expression to lowercase characters.
Date
There are a number of date functions available in the Epicor ERP application.
Function Description
98 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Function Description
Conversion
Conversion functions transform an expression of one data type to another.
Function Description
10.2.700 99
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Function Description
Converts an expression of any data type to a decimal value.
Ranges
Functions in this category return the position, string entry, or number of elements from the list, based on the
expression.
Function Description
Lookup(x,y)
[Ice].lookup(expression, list)
Returns an integer value giving the position of an expression in a list. Returns a 0
if the expression is not in the list.
Lookup(x,y,z)
[Ice].lookup(expression, list, separator )
Returns an integer value giving the position of an expression in a list. Returns a 0
if the expression is not in the list.
Entry(x,y)
[Ice].entry(expression, list, ',')
Returns a character string entry from a list based on an integer position.
Entry(x,y,z)
[Ice].entry(expression, list, separator )
Returns a character string entry from a list based on an integer position.
Num-entries(x)
[Ice].num_entries(list)
Returns the number of elements in a list of character strings as an integer value.
Num-entries(x,y)
[Ice].num_entries(list, separator)
Returns the number of elements in a list of character strings as an integer value.
100 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Financial
Functions in this category return either the fiscal year or fiscal period for the supplied date based on the fiscal
calendar.
Function Description
FiscalYear(x)
FiscalYear(company, date)
Returns fiscal year for passed date according to fiscal calendar in the database.
FiscalPeriod(x)
FiscalPeriod(company, date)
Returns fiscal period for passed date according to fiscal calendar records in the
database.
Operators
An operator is a mathematical expression either used with a single function or used to process two or more
functions.
Boolean Or (x or y) or Or operator.
Returns TRUE if either of the two logical expressions
is TRUE.
10.2.700 101
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Condition Case x When y Then case Evaluates a list of conditions and returns one of
z Else k end multiple possible result expressions.
when then
when then
else
end
102 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
BAQ Constants
The following table displays the BAQ constants you can use within the Calculated Field Editor.
CurCompName The Company Name of the company the user is logged into.
10.2.700 103
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
104 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
ProductCode The application product code. The available options include "EX" for Express,
"ST" for Standard, "EN" for Enterprise and "Epicor" for any other product
line.
ProductName The application product name. The available options include Express, Standard,
Enterprise and Epicor.
SecurityManager The current session user is a Security Manager.
Today The Current Date.
Tomorrow The next day after the Current Date.
VersionString Displays the ICE framework assemblies version of the current product. For
example, 3.0.5.0.
Week The current week of the Current Date.
10.2.700 105
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Use the Display Field Attributes Editor to add, edit or remove attributes of the fields that display on your
query.
Each DB field has a set of properties such as format or label. Using the Display Field Attributes Editor, you can
modify the existing properties and create custom ones for the current BAQ. When the BAQ runs, it uses the
field attributes you define.
To access the Editor, on the Display Fields > Column Select sheet, click the Field Attributes Editor button.
In the Editor window, all columns you selected for display are presented in the Tree View on the left. When you
select a field, the grid displays all attributes for that field. These can be:
• Default attributes specified in the system. You can accept the default state or modify these attributes as
needed.
• Custom field attributes you define for the query.
This example demonstrates how you can use the Display Field Attributes Editor to modify field properties.
1. First, on the Display Fields > Column Select sheet, identify columns you want to display on the BAQ.
106 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. Notice there are two field properties you can modify directly on the Column Select grid - Label and Format.
In this example, accept the default values on this grid.
4. In the Editor, all the columns you selected for display in the Tree View.
10.2.700 107
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. In the grid, default (system) attributes of the currently selected field display. The attributes in the default
state are grayed out and cannot be removed from the grid.
6. In this example, you override the default Caption and Format properties by modifying the corresponding
entries in Value column. Notice after property is changed, the corresponding Override check box becomes
selected, indicating the default value has changed for the current BAQ.
108 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
If you need to revert the attribute to its original state, you delete the overridden attribute and exit the
Editor window. When you launch the Editor again, the attribute is again set to its original state and the
corresponding check box becomes clear again.
7. Apart from modifying default field attributes, you can create custom ones. To do so, click New.
10.2.700 109
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. The new Attribute record is created. From the list, you can select one of the predefined attribute types, or,
you can enter the name of your choice.
Custom attribute names are not case sensitive. Be sure to enter unique names when defining custom
attributes for a SubQuery. Attributes are specific to each table and SubQuery. For example, if your BAQ is
made of two SubQueries referencing the same DB table, different field attributes can be specified for each
SubQuery.
For more info on the list of predefined attributes, review the Extended Property Maintenance topics within
the Application Help.
9. In this example, you create a custom attribute for a user-defined field. Similarly, you can create another
custom attributes you need to use within the current BAQ.
110 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
11. Exit the Editor. Notice the Label (Caption) and Format properties you modified for the Customer ID column
display on the grid.
10.2.700 111
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Use the Advanced Group By Clause Editor to build advanced data summarizing expressions.
In BAQ Designer, you can use the following data grouping options:
• Simple Group By mechanism - You can group the query results by specific column(s) by selecting the Group
By check box on the Column Select sheet. This feature, however, has a few limitations - it is only available
for fields selected as Display columns and within the resulting Group By clause, these fields always appear in
the same order as in the Select statement.
• Advanced Summarizing Options - By accessing the Advanced Group By Clause Editor, you can create more
complex summarizing expressions, such as:
• Group BAQ results by fields different from those defined in the SELECT statement.
• Define custom order of columns in a GROUP BY clause.
• Use special GROUP BY operators, such as ROLLUP, CUBE, and GROUPING SETS. These operators are
extensions of the GROUP BY clause. They can generate the same result set as when you use UNION ALL
to combine single grouping queries; however, using one of the GROUP BY operators is usually more
efficient.
112 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
In this example, assume you want to analyze on hand-quantities of specific parts located within several warehouses.
Learn how to use the available Group By operators to get the expected results.
1. Create a new BAQ and place the PartBin table on the canvas.
2. In this example, a filter on the table is applied to only retrieve records for parts 1032x073 and 1032KNUT.
3. For the Display Column(s), select the PartBin_WarehouseCode and PartBin__PartNum columns.
10.2.700 113
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. Also, create a calculated field that summarizes on-hand quantities of selected parts.
Use the following calculation:
sum( PartBin.OnhandQty )
5. Now access the Advanced Group By Clause Editor by clicking the button.
Similar to the Calculated Field Editor, the window contains lists of available fields, functions, and operators.
You can add these items to an expression by either double-clicking them or dragging and dropping them
onto the editor window's Expression Editor field.
For the complete list of predefined functions, operators, and BAQ constants, see the Application Help topics.
114 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. At the top of the Functions node, notice the Group By category displays.
The ROLLUP, CUBE, and GROUPING SETS operators found in this category represent advanced aggregation
extensions of the GROUP BY clause.
Function Description
ROLLUP
The ROLLUP operator is useful in generating reports that contain subtotals and totals. It
generates a result set that shows aggregates for a hierarchy of values in the selected
columns.
As a result, one row with a subtotal is generated for each unique combination of values
of (a, b, c) , (a, b) , and (a). A grand total row is also calculated.
CUBE
Generates simple GROUP BY aggregate rows, the ROLLUP super-aggregate rows, and
cross-tabulation rows. CUBE outputs a grouping for all permutations of expressions in the
<composite element list>.
As a result, one row is produced for each unique combination of values of (a, b, c) , (a,
b) , (a, c) , (b, c) , (a), (b), and (c) with a subtotal for each row and a grand total row.
GROUPING
Specifies multiple groupings of data in one query. Only the specified groups are aggregated
SETS
instead of the full set of aggregations that are generated by CUBE or ROLLUP. The results
are the equivalent of UNION ALL of the specified groups. GROUPING SETS can contain a
single element or a list of elements. GROUPING SETS can specify groupings equivalent to
those returned by ROLLUP or CUBE. The <grouping set item list> can contain ROLLUP or
CUBE.
For more information on the above operators, review the available Microsoft® documentation, for example:
• http://technet.microsoft.com/en-us/library/bb522495(v=sql.105).aspx
• http://technet.microsoft.com/en-us/library/ms177673.aspx
• http://blogs.msdn.com/b/craigfr/archive/2007/10/11/grouping-sets-in-sql-server-2008.aspx
10.2.700 115
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. In this example, double-click the ROLLUP function. Place you cursor in the middle of empty brackets. For
Group By expression fields, double-click both the PartBin.WarehouseCode and PartBin.PartNum fields,
separated by a comma.
The Group By expression should now read:
ROLLUP( PartBin.WarehouseCode, PartBin.PartNum )
11. Notice the total values are summarized by each warehouse and part (aggregate rows), sub-totals rows for
each warehouse with the grand total value displaying at the bottom.
12. Notice how BAQ results change when GROUPPING SETS function is used to construct the GROUP BY clause.
GROUPING SETS( PartBin.WarehouseCode, PartBin.PartNum )
116 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
13. Notice how BAQ results change when CUBE function is used to construct the GROUP BY clause.
CUBE( PartBin.WarehouseCode, PartBin.PartNum )
10.2.700 117
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
CUBE outputs a grouping for all permutations of expressions in the composite element list.
The Advanced Data Aggregation case study found at the end of this chapter shows more complex
scenario on how to aggregate results from multiple tables.
Sort Order
The Sort Order sheet is where you define how the data results display when the query runs. You can sort your
data through any combination of columns. You can also select whether the data displays in ascending or
descending order.
You can only add sort fields for the main query or for the
SubQueries using the TOP clause. Otherwise, the BAQ fails on
execution.
1. In the Available Columns section, highlight the column by which you want to sort data.
You can also use keyboard combinations to select multiple fields. You can click one field and then press
and hold the Shift key to select a range of fields. You can also press and hold the Ctrl key and select a
specific group of fields.
The data in this query is now sorted first by Company, then by Sales Order Number, and lastly by Sales Order
Line Number.
118 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. Click the Right Arrow button or drag and drop the column names to the right pane.
The columns are added to the Sort By field.
3. If you need, use the Up and Down Arrow buttons to change the sorting order.
10.2.700 119
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. To control if data should be sorted in ascending or descending order, double-click the selected column. The
direction is reflected on the small triangle that displays next to the selected column.
5. To remove a column from the sort list, highlight it and click the Left Arrow button.
120 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
SubQuery Options
By default, a simple query contains only one subquery with the following attributes:
Field Value
Name SubQuery1
Type TopLevel
Results Row Set All
When you add new subqueries to the BAQ, all subqueries, excluding Inner subqueries, are ordered by the Seq
field. Each query text is generated and these texts are concatenated. No assumption of the subquery order is
made.
10.2.700 121
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
When you create a new BAQ, the main subquery named SubQuery1 is created by default.
To set up the main subquery:
1. Create a new query and specify its main parameters on the General sheet.
3. In the Name field, enter the name of the main subquery. In this example, the BAQ returns the list of quotes
from the QuoteHed table. To identify the subquery, you can enter this value in this field.
5. In the Result Set Rows field, select how data displays in the subquery results set.
The table below lists the available options:
Keyword Description
All Default value; the SELECT ALL returns all data without restriction.
Distinct SELECT DISTINCT specifies that only unique rows can display in the result set.
122 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Keyword Description
Top SELECT TOP specifies the number of rows or percent of rows to return.
You can specify either the 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 the ORDER BY clause is specified.
DistinctTop SELECT DISTINCT TOP corresponds to using DISTINCT and TOP clauses simultaneously.
The query results set contains top unique rows.
6. When the Top or DistinctTop keyword is selected in the Result Set Rows field, the Top Clause pane becomes
enabled. Also notice the Order By OFFSET - FETCH Clause pane is now disabled.
7. In the Rows Number field, enter the number of rows or percent the query results set should return. You
can, for example, have the query return the list of 50 latest quotes for a review.
8. If you select In Percent, the top percent of rows specified in the Rows Number field is returned in the results
set.
9. If you select With Ties, the query result set includes any additional rows that match the values in the ORDER
BY column or columns in the last row returned.
10. The Offset and Fetch fields provide you with an option to fetch only a window or page of results from the
result set. You can use the Offset field to enter the number of rows to skip, before starting to return rows
from the query expression.
10.2.700 123
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. The value you enter in the Fetch field specifies the number of rows to return after processing the OFFSET
clause.
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 ONLY
Create SubQuery
When you construct a query, you can add various types of subqueries and indicate how they correlate with each
other.
To define a subquery:
124 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. In the Type field, select the type of correlation between subqueries. By default, the subquery is set to the
InnerSubQuery type. In this example, combine the current subquery's results with the TopLevel subquery
using the Union operator.
The table below lists all available options you can use for the subquery:
Type Description
TopLevel Default value for a simple query; each BAQ can contain one main TopLevel subquery.
Union Selects related information from two tables, much like JOIN. However, when using
UNION, all selected columns need to be of the same data type. With UNION, only distinct
values are selected.
UnionAll Equal to UNION, except that UNION ALL selects all values.
The difference between UNION and UNION ALL is that UNION ALL does not eliminate
duplicate rows; instead it just pulls all rows from all tables fitting your query specifics
and combines them into a table.
10.2.700 125
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Type Description
Intersect Returns the results of two or more selected queries. However, it only returns the rows
selected by all queries. If a record exists in one query and not in the other, it is 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 defined
within the execution scope of a single SELECT (or may serve as a subquery, instead of
SELECT).
Common use of CTE is to query hierarchical data. Returning hierarchical data is common
use of recursive queries, for example: displaying employees in an organizational chart,
or data in a bill of materials scenario in which a parent product has one or more
components and those components may, in turn, have subcomponents or may be
components of other parents.
InnerSubQuery Usually added to 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 the SELECT statement but do not know the exact value.
5. In the Result Set Rows field, select how data displays in the subquery results set.
For more information on the Type and Result Set Rows options, review the previous Define Main SubQuery
topic.
126 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. Add table(s) you need to construct the subquery. Use the techniques defined in the Phrase Build topics to
create the BAQ.
10. On the General sheet, in the Query Phrase section, view the resulting SQL statement.
11. In this example, notice the TopLevel subquery displays at the top of the SQL statement, followed by the
second subquery of the Union type.
10.2.700 127
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
12. Navigate to the Analyze sheet and verify the syntax is OK and the BAQ returns expected data.
128 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
1. On the Query Builder > Phrase Build sheet designer canvas, select item(s) you want to move to another
SubQuery.
To select multiple items, hold Ctrl and select items of your choice.
10.2.700 129
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Right-click any of the selected items to open the context menu and select Move to SubQuery.
130 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. Click OK.
The BAQ Designer switches to the SubQuery you selected. The tables and SubQueries you selected for
transfer display on the canvas, including their relations.
SubQuery List
Use the SubQuery List sheet to view and manage all subqueries you create within the BAQ.
In the grid, all subqueries you create are ordered by the sequence number. Except inner subqueries, the sequence
number defines how partial query texts are concatenated to build the final SQL statement. If a subquery contains
reference to an inner subquery, the text of the inner subquery is generated on demand and inserted where
required.
On the subquery panel, you have the ability to create and remove subqueries, change their sequence value, and
view how data displays in the results set.
To manage subqueries:
2. To create a new subquery, click the New SubQuery button. You must then define its main parameters on
the SubQuery Options list.
10.2.700 131
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. To move the selected subquery up in the list, click the Up Arrow button.
5. To move the selected subquery down in the list, click the Down Arrow button.
6. You can use parentheses to group SubQueries and create the following query constructions:
• Addition of Union SubQueries to InnerSubQueries.
• Grouping of Set-Operator SubQueries.
Note when a group for an inner SubQuery is created, the field mapping is shown using this first inner
SubQuery:
Top
Inner <- some separate inner SubQuery
Union <- fields are selected according to the Top field list
Top
(Inner <- groups with next Union
Union)<- Fields correspond to Inner SubQuery
Besides using BAQs to display custom views of data, you can also create updatable business activity queries.
These updatable queries have business object methods connected to them, so users can create and edit records
- updating the database through the query itself.
You create updatable BAQs in a similar way to display only BAQs by adding tables, filter criteria, display columns,
and so on. You have some extra steps, however, as you need to define which table contains the updatable fields
and also make sure the business object methods are correctly linked to the updatable fields.
Just like a read-only BAQ, you can link as many tables in relationships as you need. Multiple tables accessed by
each BAQ can be updatable, however, so you can construct updatable BAQs that contain as many updatable
fields as you need. The one limitation is that only one business object involved in each process can contain an
updatable BAQ, but because multiple updatable table combinations are possible, you should be able to create
an updatable BAQ that matches your needs.
Epicor ERP supports connection to the read-only copy of the database, if available, to reduce the workload on
the live database. For example, the Always On availability groups feature of the SQL server allows to configure
a primary read-write database and its several read-only replicas. If necessary, the Use Primary Database execution
setting in the BAQ Designer allows users to ensure that a particular BAQ is executed against a primary read-write
database. Updatable BAQs require assured access to the most up-to-the-second data. Therefore, Updatable BAQs
are always executed against a primary database.
If you are interested in learning more about how SQL Server can be configured to support the read-only
database capability, please refer to the Microsoft® documentation for information on the Always On availability
groups feature of the SQL Server®.
You can place updatable BAQs on smart client dashboards. After you add these dashboards to the Main Menu,
they become custom data entry programs users can launch to both review current data and make any updates
they need. Optionally, you can also use updatable BAQs on mobile device dashboards. Once you create a mobile
dashboard that contains an updatable BAQ, users run this custom entry program on an iPhone, Blackberry, or
other supported mobile device. Users enter data through the mobile device, directly updating the database
132 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
wherever they may be. To build mobile device dashboards, you must purchase a mobile device dashboard license
from Epicor.
User Rights
Although you can access most BAQ functionality, to create and modify updatable BAQs, you must have both
advanced BAQ and advanced BPM rights. Because the updatable business activity queries run through BPM
methods, you need to use these advanced features. You activate advanced BAQ and BPM rights on your account
within User Account Maintenance.
To assign updatable BAQ rights to a user account:
Menu Path: System Setup > Security Maintenance > User Account Security Maintenance
1. Use the Detail sheet to find and select the user record you need.
10.2.700 133
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
134 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
This user account can now access the updatable BAQ features. The next time you log into the application through
this user account, you can use the Update sheets within the Business Activity Query Designer.
General Properties
Use the controls on the General Properties sheet to indicate how users can enter and edit records through the
updatable BAQ. You also indicate which fields are available for data entry.
1. Create a new BAQ. To activate the sheets under the Update tab, one the General sheet, select the
Updatable check box.
In this example, an updatable BAQ using the Customer table is used.
10.2.700 135
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Define the main options for your updatable query. Navigate to the Update > General Properties sheet.
3. Select the Allow New Record check box to indicate users can add new records through this updatable
BAQ.
When this check box is clear, users can only update existing records.
4. If you wish, specify the Label for AddNew value. This value defines what appears on the drop-down menu
next to the New button on the Standard toolbar.
The text you enter here displays as a node on this drop-down menu. Make sure it identifies the purpose of
the new record the users create through this updatable BAQ.
5. Select the Allow Multiple Row Update check box to give users the ability to make changes to two or
more rows in a table at the same time.
If this check box is clear, users are required to save one changed row before they can work on another
row.
136 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. To make new actions available for use within an updatable BAQ directive, you need to create action
placeholders by clicking the Define Custom Actions button.
9. Enter an ActionID. This identifier defines the custom action within the updatable BAQ.
10. Enter an ActionLabel. This value defines how the action displays on buttons within the dashboard.
11. If you wish to remove a custom action, click the Delete button.
12. Continue to add the custom actions you need. When you finish, click OK.
14. You can also launch the Define Custom Action window from the Actions menu. To do this, from the Actions
menu, select Define Custom Action.
10.2.700 137
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Use the Query Field List to indicate which Display Column fields the users can update. You can also create or
select default values that automatically populate a field.
1. The Alias field displays the specific name for each column within your updatable BAQ TopLevel SubQuery.
138 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. The Data Type field indicates the kind of data contained within the specific field. Available types:
• nvarchar - Alphanumeric characters
• int - Whole numbers only
• decimal - Numbers which also contain decimal places
• bit - Defines a True/False value; on the interface, logical fields appear as check boxes or radio buttons
• date - Date (month, day, year) values only
• datetime - A date value which also includes the time
• uniqueidentifier- A Globally Unique Identifier value
• bigint - Used when column contains numbers too large for the Integer data type
3. The Updatable column indicates which fields are allowed for data updates. You can specify which fields
you want to update through this BAQ by selecting the corresponding check boxes. You can also use the
Updatable column header check box to set multiple fields at once.
4. Use the Mandatory column to specify which BAQ fields become required. This indicates which fields cannot
be empty when you attempt to save a record to the database.
You can configure the list of mandatory fields manually, by selecting the check box for each of the fields
you need.
5. If you want set multiple fields at once, use the Mandatory column header check box. This control behaves
the same way as for the Updatable column described in step 4.
6. You cannot update a field if it's specified as ReadOnly in the source table. This check box displays for your
information and cannot be modified. If this check box is selected, users cannot change the data that appears
in this column.
7. Use the Initial Expression field to enter a text value that displays in the field before users actually enter
data in it. Use this feature to place some instructional text in the field to help the user understand what
information is required for this field.
8. If you want to create a calculation to determine the initial expression, click the Column Initial Expression
button. This launches the Updatable Field Initial Expression window; use the controls on this window
to create a formula that generates the initial expression you need for a specific field.
10.2.700 139
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Allowed
• Any .net functions that return scalar value of acceptable data type can be used. For
Elements
example, you can specify this initial expression for an integer data type field like
DateTime.Now.Year.
• If you have BPM Advanced User rights you can refer to database table field values.
The expression should results in scalar value of acceptable data type. For example,
this.Db.ABCCode.First().Company.
• BAQ constants can be used.
Not Allowed
• Initial Expression is specified for the fields on the record added to query result table.
Elements
This record is current during expression execution, so reference to another query
result table record is not allowed.
• The order of field initialization is not determined, so reference to another field in a
new record is not allowed.
• The ttResult variable is not allowed in Initial Expressions. It causes errors when the
Check Syntax, BAQ Analyze, or query validation (on save) action is performed and is
not supported by auto-complete. The presence of ttResult is not verified during import
so legacy queries may be imported without any errors.
• Current row fields cannot be used. For example, you cannot specify the
ABCCode_PcntTolerance expression for the ABCCode_StockValPcnt field.
• Only single line statement is allowed, so you cannot use semicolon delimiter and
single line comments.
9. You can also define specific acceptable values that will be available in a specific field. To do this, click the
Advanced Column Editor Configuration button.
This feature is discussed in the following topic.
Use this window to define the type of data the users will enter through this updatable BAQ field. You can define
text fields, date fields, number fields, drop-down list options, and radio button options through the controls in
this window.
Updatable BAQs use two field format definitions. The format you specify on the Display Fields > Columns
Select sheet defines how a field value displays in the read-only mode, for example, in a grid.
You can define a second format in the Updatable field editor. This way, you can define different formats; for
example, x(10) for display and >>,>>9.99 for editing.
This window is similar to the Query Parameters window described in the previous Phrase Build - SubQuery
Criteria section.
140 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
1. Use the Tree View to select an updatable field for which you want to define values.
2. Select the Data Type for the parameter from the drop-down list. Available types:
• nvarchar
• integer
• decimal
• date
• dateTime
• bit
• uniqueidentifier
• bigint
3. In the Format field, the default format for this Data Type displays.
If you need, you can edit this value. Make sure the format follows the convention of the database.
4. If this field is required in order for the BAQ to pull in query results, select the Mandatory check box.
5. Use the Editor Type drop-down list to define the editor control the user will have for entering data within
the updatable field. Available options:
Option Description
Common Editor Activates the Editor Default field. Enter a custom text value you need for the
field.
This text appears by default; users can then enter a different value in this field.
10.2.700 141
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Option Description
Radio Button Set Activates the Values Editor sheet. Use this sheet to define the various radio
button options for this field. Users can then select a radio button option from
the values you define in this window.
DropDown List Activates the Data from drop-down list. Use this list to define the source of
the drop-down list options. The field then displays options contained in the
drop-down list.
6. If you select the Common Editor option from the Editor Type drop-down list, the Editor Default field
becomes active. Enter the default value you want within this field. When you use this updatable BAQ in a
dashboard, this value is used to perform field level validation either before changes to a field are saved to
the database or after updates to the field are changed and returned for display on the interface.
7. If you want this field to generate a Business Process Management (BPM) method, select the Raise Events
check box. When you complete your updatable BAQ on the Update Processing sheet, you can see these
new methods within the Updatable BAQ Method Directives window. On the finished Dashboard assembly,
this is used to perform field level validation before proposed changes to the field are committed or to perform
additional updates after the field value changes.
8. If you want the field to have access to a quick search for finding and selecting data entry values, click the
Quick Search button to locate the quick search you need. You create quick searches through Quick Search
Maintenance; these configurable search programs display input criteria to use for a search, display search
result fields, and return the data from the specific field you define. For more information on quick searches,
review the Quick Search section within the Searches chapter.
9. If you select the DropDown List option from the Editor Type drop-down list, the Data from field becomes
active. Use the options from this drop-down list to indicate the source from which the data on this list
populates. Available options:
Option Description
Custom Values
Causes the Values Editor to display controls for creating a new list of values. Use this
functionality to define the various list options this drop-down list will use.
Enter the following information:
• Value - Enter the actual value of the parameter that will be sent to the query.
• Display Text - Enter the text displayed for the user for this value.
• Order - Defines the sequential order of items in the list.
BAQ The Values Editor displays controls for selecting a BAQ. Enter the following information:
• Query ID - search for and select the BAQ you need.
• Display Column - select the column that displays in the lookup list.
• Value Column - defines the name of the column you want to use for the field value.
User Codes Causes the Values Editor to display controls for selecting a specific User Code. User codes
are lists of custom values you define through User Defined Code Maintenance. When
you select a user code, the drop-down list populates with values contained within the
custom user code record. For more information about creating user codes, review the
User Defined Codes Maintenance help topics.
142 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. Continue creating values for all of the updatable fields you need. When you finish, click Save.
Update Processing
In order for your updatable BAQ (uBAQ) to work properly, use the controls on the Update Processing sheet to
select and configure a processing method used to update the target database.
You can select one of the following processing types:
1. Use the Service Connect Workflow method to set up the interaction of business activity query with Epicor
Service Connect (ESC). Database updates are performed using the ESC workflow created directly from the
Business Activity Query Designer.
2. Use the Advanced BPM Update only method to create a BPM directive manually from scratch, or to
customize the directive generated by BPM Update processing. Updatable BAQ directives initiate BPM actions
based on method calls launched from an updatable BAQ.
3. Use the BPM Update method to perform database updates using the special Business Object method
UpdateExt that simulates the standard way of how application manipulates data within business objects.
You can use Epicor ERP to cooperate with Epicor Service Connect (ESC). Once configured, you can create or
execute ESC workflows directly from within the Epicor ERP application.
Calls to Service Connect can be performed from within:
• Business Process Management (BPM) directives - Within a BPM workflow, you can use the Call SC Workflow
action to initiate the ESC workflow execution. To establish connection, BPM uses the WCF service exposed
by ESC.
10.2.700 143
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
• Updatable Business Activity Query (uBAQ) - Besides using BAQs to display custom views of data, users
can also enter data directly within business activity queries. These uBAQs can utilize events inside Epicor Service
Connect workflows, so users can create and edit records - updating the database through the query itself.
When the uBAQ is created or is being edited, it attempts to create or update the workflow definition, as well as
the corresponding request and response schemas. In order to call the existing workflow to process events or
apply updates, as well as to create the new workflow, uBAQ uses the BPM Integration WCF Service. The service
is installed when the Integration WCF Services feature is installed on the ESC server. In order to use this service,
uBAQ must authenticate in ESC.
For more details on how to configure both applications, review the Epicor ERP and Epicor Service Connect
Interoperability topics found in the Application help.
Default Epicor Service Connect logon parameters are defined on the Company Maintenance > General Settings
sheet.
Navigate to Company Maintenance.
Menu Path: System Setup > Company/Site Maintenance > Company Maintenance
144 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. In the Server field, enter the enter Full Domain Name of the server where the Service Connect application
is installed.
3. Enter the User name and Password of an Epicor Service Connect user account that has rights to the server.
4. Click the Test Connection button to verify the connection to the Epicor Service Connect server is established.
10.2.700 145
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. In the UBAQ Workflow Package field, select the default workflow package where workflows created
from Business Activity Query Designer are placed.
At the new workflow creation, you can override this value by selecting a different workflow package than
default.
Use the following steps to learn how specify the workflow used with the uBAQ, configure workflow design and
run-time credentials.
1. First, specify the ESC server name and run-time credentials you want to save with the query. To do this, click
the Server button.
3. Click the Test Connection button to confirm you can access the specified server.
The ESC logon information used when the query activates is now configured within the BAQ.
146 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. When you click the Configure button, you are first presented with the Logon To Service Connect dialog.
On this dialog, you can:
• Accept the credentials entered on the Select Epicor Service Connect Server window launched using
the Server button (either company default or custom ones).
• Enter custom ESC credentials you want to use while building the query.
5. By clicking OK, you are presented with the Select Workflow window.
10.2.700 147
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. The Server field displays the FQDN name of the specified server where ESC is installed.
7. The Server URL automatically displays the integration service that handles communication between Epicor
ERP and Epicor Service Connect.
By default, the service URL is https://<server name>/BPMIntegrationWcfService/SCIntegrationWcfService.svc
8. If you want to use an existing workflow, in the Workflows tree view, search for and select a workflow you
want to use.
9. The workflow and package you select display in the Chosen Workflow field.
10. When you click Refresh, the list of packages and workflows is refreshed.
11. When you click the Advanced button, you are presented with the Workflow Context Parameter window.
The information on this window is shared between the BAQ Designer and BPM. The ESC server credentials
you enter allow calling of Epicor services from the Epicor Service Connect side by using imported .Net
references.
12. If you want to create a new workflow, click the Create New button and specify the workflow package and
workflow name.
14. The following steps discuss how you can create a new workflow / select existing one using the New button.
148 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
15. If the company default ESC server information is entered on the Company Maintenance > General sheet,
clicking the New button invokes the Enter Workflow window.
16. On this window, in the Select a Workflow package field, you can either accept the default workflow
package or select a different package where you want to save the new workflow.
17. In the Enter new Workflow name field, type the name of the workflow to be created.
Good practice is that BAQ and workflow are named the same.
19. The parameters you specified now display in the read-only field.
10.2.700 149
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
The standard ESC template workflow and corresponding schemas are created directly from the Business Activity
Query Designer.
150 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
The following is the list of events the generic Service Connect workflow handles:
• GetNew - This method generates a new record and adds it to the database table. If your updatable BAQ
allows users to enter new records, when users create new methods they activate this method. A new, blank
row is created within the updatable table, and the user populates the fields linked to this row with new data.
• Update - This method refreshes the information within the database with new information a user has entered
in the updatable BAQ. When you test your updatable BAQ by modifying existing data, this method runs when
you click the Update button. When the updatable BAQ is embedded within a dashboard, this method runs
when the user enters new data and clicks the Save button.
• CustomAction - Use this method to run custom actions you define on the uBAQ.
• FieldUpdate - This method occurs after the user's change to a field is committed. You can use this method
to perform additional processing against the changed row. For example, when you enter a part number, you
want the part description field to populate automatically.
• FieldValidate - This method occurs before the proposed change to a field is committed. You can use this
method to validate proposed changes. For example, you can prevent users from entering an incorrect value
in a certain field such as non-existent state.
You can customize the workflow so it meets your business process requirements. Use the available Epicor
Service Connect documentation to learn how to build workflows which can automate processes, connect
different business entities, applications, or users.
Use this method to perform database updates using the special Business Object method UpdateExt. This update
method governs the whole data transaction process between the updatable BAQ and the related Business Object.
To use BPM update processing:
10.2.700 151
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. The Select Business Object window displays. The business objects for the tables on the current BAQ display
by default in this window.
5. Select the business object you want from the Suggested business objects list.
6. The Update Method indicates the method used to enter the changes made through the updatable BAQ
to your database. By default the UpdateExt method displays, which is the update method used on all
updatable BAQs.
7. If you need, you can select a different business object by clicking the Select Business Object button.
8. When you have selected the business object you want, click OK.
9. When you select a Business Object and a method, the Tables to update pane displays the hierarchical tree
of all tables, participating in the UpdateExt method.
After you select a BO, uBAQ automatically attempt to synchronize Column Mappings. If uBAQ display list
contains table fields corresponding to table fields from the UpdateExt tables list, mapping between these
fields is automatically created. Within the Tables to update tree, a checkbox displays next to each table for
which such mapping was found.
In the process of field mapping between BO and BAQ, you can select / deselect different tables based on
your needs. Only tables, checked in the tree -view will participate in Column Mapping and used in update.
152 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. The two sheets at the bottom display columns are mapped with the following distinction:
• The Input Column Mapping defines how data is pulled from the uBAQ table to the Business Object
table.
• The Output Column Mapping defines how data is pulled to the uBAQ from the Business Object, after
the UpdateExt method executes.
The Column Mapping sheets are discussed on the following topic.
Column Mapping
After you select a BO, uBAQ automatically attempt to synchronize Column Mappings. You can modify this
information to create custom mapping between BAQ and Business Object.
The following list outlines how BAQ Column Mapping works:
• If BO table field is used in either Input or Output Column Mapping, then input mapping for all its primary key
fields must be provided in order to uniquely identify table rows.
• Deletion of an input mapping for a key field is not allowed.
• BO UpdateExt tables are organized in the Tree-view. To update a child table, the primary key values of all
parent tables must be supplied in Input Column Mapping.
These required columns are automatically added when you click the Synchronize button, or when you
regenerate the BPM Directive by saving the BAQ.
10.2.700 153
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
• If BAQ cannot suggest mapping automatically, the right side of Input Column Mapping assignments shows
no mappings. A corresponding error message displays when BPM Directive is regenerated on BAQ save.
1. The Query To Object Column Mapping defines assignments of BAQ fields to the Business Object table
fields.
2. The Table field displays the table name, used on the left side of a mapping assignment.
For Input Column Mapping, this field displays the Business Object table name.
3. The Field field displays the Business Object table field name.
4. The .Net Data Type field indicates .NET data type of the field such as Boolean, Integer or String.
5. When the Required check box is selected, it indicates that users must enter data in this field before a new
record is saved. If they attempt to save the field without entering data in it, an error message displays. The
information in this field is supplied from Business Object, where the specific column is marked as required.
6. When the Key Field check box is selected, it indicates this BO field is part of primary key and input value
is required for UpdateExt functionality.
7. The Expression column displays the equation used to pull data from the updatable BAQ into the Business
Object table.
8. You can use the editor to manually create an expression you want to assign (or map) to the
MapTableName.MapTableField. Click the Expression Editor button to launch the Business Object Update
C# Expression window.
9. The Editor displays the expression used to pull data from the updatable BAQ into the Business Object table.
154 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. When you launch the Business Object Update C# Expression from the input mapping, the Add All Mandatory
Fields option becomes available on the Actions menu. This option adds all fields from TopLevel Display
Columns to the output mapping. You must then make sure all empty mapping expressions are filled.
11. To verify the expression is available for use within the uBAQ, use the Check Syntax button. Any errors are
reported in the grid below the Editor pane.
Note the validation process reacts on:
• Empty Expression Statement
• Syntax Error
• Security Issue (non-advanced BPM users)
12. The Object To Query Column Mapping sheet defines how data is returned to the BAQ from the Business
Object.
10.2.700 155
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
13. For Output Column Mapping, the Table field displays a ttResult variable, corresponding the current row in
BAQ execution results table.
14. The Field field displays the BAQ ttResult field name, containing selected field Alias.
15. You can use the Allow Nulls checkbox to manually specify that result can contain a null value.
16. You can use the Expression Editor button to manually create an expression you want to assign (or map)
to the selected Table.Field. Note that BAQ columns within an expression should be referred as ttResult.Alias
columns.
17. When you launch the Business Object Update Expression from the output mapping, the Add All Result
Fields option becomes available on the Actions menu. This option inspects the BO and adds all fields marked
as required, to the input mapping. You must then make sure all empty mapping expressions are filled.
156 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
18. For both input and output column mappings, you can use the toolbar above the grid to add and remove
rows from mapping and sort columns in an alphabetical order. The Synchronize option inspects all tables
within the BO. If BO tablename and field name exists in the BAQ display field - a new mapping row is
automatically created.
10.2.700 157
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Business Objects contain the code that calls a database, sending current data to a custom dashboard for display,
or populating the database with new data. A business object (also called a BO) houses the methods used to
enter, view, and calculate data for a specific function within an application.
Each process a business object can run is called a method; by default each updatable BAQ contains the following
methods:
• GetNew - This method generates a new record and adds it to the database table. If your updatable BAQ
allows users to enter new records, when users create new methods they activate this method. A new, blank
row is created within the updatable table, and the user populates the fields linked to this row with new data.
• Update - This method refreshes the information within the database with new information a user has entered
in the updatable BAQ. When you test your updatable BAQ by modifying existing data, this method runs when
you click the Update button. When the updatable BAQ is embedded within a dashboard, this method runs
when the user enters new data and clicks the Save button.
• Get List - Retrieves the data specified by the query.
• CustomAction - Use this method to run custom actions you define on the uBAQ.
• FieldUpdate - This method occurs after the user's change to a field is committed. You can use this method
to perform additional processing against the changed row. For example, when you enter a part number, you
want the part description field to populate automatically.
• FieldValidate - This method occurs before the proposed change to a field is committed. You can use this
method to validate proposed changes. For example, you can prevent users from entering an incorrect value
in a certain field such as non-existent state.
Each of these methods can be monitored through Business Process Management (BPM) directives. BPM
customization allows using of mostly all BPM Method directive actions and conditions for processing query data.
When you create an updatable BAQ, the application writes a base processing directive for the update method.
The directive uses C# code to update the database according to the settings defined in the Business Activity
Query Designer. These directives can evaluate the data passed into or out of the database, interrupting the
processing when certain conditions you define are met. Various actions, again which you define, then automatically
run in response to the condition. You create these Updatable BAQ Method Directives from within the Business
Activity Query Designer, or, you can access the program directly from the main menu:
Menu Path: System Management > Business Process Management > Updatable BAQ Directives Maintenance
To following are the ways of using the Advanced BPM processing functionality:
1. Business Activity Query Designer helps users with updating data via a selected business object. For these
purposes, the UpdateExt method is used. This update method governs the whole data transaction process
between the updatable BAQ and the related Business Object (BO). When you select the BPM Update option
on the Update Processing sheet, you activate the BPM Update Processing section to configure data updates.
158 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. You do this by selecting an appropriate Business Object and defining data Mappings between BO's dataset
and query display fields.
3. Click the BPM Directives Configuration to access the Updatable BAQ Method Directives.
4. Based on the information you specified in BPM Update Processing, the BAQ Designer generates the Base
Processing directive against uBAQ.Update method.
10.2.700 159
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. This directive is named #BASE# and contains a workflow item with custom C# code, which prepares data
and calls UpdateExt for selected BO.
Access to #BASE# directives is only available to users having Advanced BPM User rights.
160 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. Also, Base Processing directive for the GetNew method is automatically generated if the Allow New Record
option is selected on the Update > General Properties sheet. This directive is also named #BASE# name
and it contains C# code with field assignments for new row as defined in Initial Expression column defined
on the General Properties.
7. However, the BAQ Designer gives you the ability to modify the directives for any methods. By using the
Advanced BPM Update only option, you can create a BPM directive manually from scratch, or, to customize
the directive generated by BPM Update processing.
8. If you do not specify BPM Update Processing and launch Updatable BAQ Method Directives, then no #BASE#
directives are generated automatically for the GetNew and Update methods. Use this option to customize
the method completely by yourself.
For more information on how to build a directive and which workflow elements are available for use with
uBAQ directives, review the Business Process Management chapter.
Analyze
Use the Analyze sheet to both analyze and test your query for any possible problems before you use it in the live
application.
Run the data controls on this sheet to verify that the data results you need populate on this grid. If you are not
seeing the results you want, you can return to the Query Builder sheets to modify the query and then test the
results again.
Additionally, the Analyze sheet contains the functionality you use to verify and updatable BAQ can pull in (get)
data, update records, and add new records. You can also use this sheet to test a custom Business Process
Management (BPM) method against the updatable BAQ. After you verify the updatable BAQ can perform all of
the functions successfully, you are ready to place it on smart client and mobile device dashboards. Users can then
enter and update the data they need through this query.
10.2.700 161
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
After you create a query, verify its functionality on the Analyze sheet.
To verify a query:
3. To set the maximum number of rows returned by the query, you can select a value from the Rows to Return
list.
You can either select one of the predefined values or you can enter a custom value:
• <empty>
• 10
• 50
• 100
Note the value entered in this field is not saved with the BAQ, it is used for testing purposes only.
162 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
If an empty value is selected, then, by default, the query returns maximum of 10,000 records. This limitation
is only applied on retrieving BAQ results while testing their execution. If you need to turn this limit off, from
the Actions menu, click Execution Settings and set the RemoveTestRowLimit parameter to True.
5. If the BAQ runs too long, you can cancel its execution using the X button that displays to the right of the
Clear Grid button.
6. To remove the query results and Query Execution Messages, click the Clear Grid button.
10.2.700 163
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
164 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Before you use verify the updatable BAQ functionality, define what fields users can update and set up a processing
method of your choice. You do both tasks using the sheets under the Update tab.
1. To set the maximum number of rows returned by the query, you can select a value in the Rows to Return
field.
From the drop-down list, you can either select one of the predefined values or you can enter a custom value:
• <empty>
• 10
• 50
• 100
Note the value entered in this field is not saved with the BAQ, it is used for testing purposes only.
If an empty value is selected then by default, the query returns maximum of 10000 records. This limitation
is only applied on retrieving BAQ results while testing their execution. If you need to turn this limit off, access
Execution Settings from the Actions menu and set the RemoveTestRowLimit parameter to True.
2. Click the Get List button to test whether the updatable BAQ can pull in data from the database.
10.2.700 165
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. You are warned this test may launch BPM directives that update the database. Click Yes.
4. If the BAQ runs too long, you can cancel its execution using the X button that displays to the right of the
Clear Grid button.
5. The Query Results grid populates with data. You now can test the BAQ to find out if you can update
existing records.
7. The Fields window displays. This window contains all of the fields you indicated were updatable on the
Update > General Properties sheet. Enter a new value in one of the fields.
In this example, you modify the address of a supplier record.
166 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
8. If an updatable field was selected to raise BPM events within the Updatable field editor, two additional
buttons display next to this field. The V button performs the FieldValidate BAQ method directives; the U
button performs the FieldUpdate BAQ method directives described for the field.
10. The record you updated is now highlighted within the Query Results sheet.
10.2.700 167
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. If you want to save this change to the database, click the Update button.
12. The record is now updated. To verify the update to the database was successful, you can click the Get List
button again to retrieve the updated DB results. You can also open a specific program that should reflect
your changes, for example, Supplier Maintenance and verify your changes there.
13. If you want to add new records to the updatable BAQ, click the Get New button.
14. A blank row displays on the Query Results list. Double-click the empty row.
168 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
15. The Fields window displays. Initially, all the fields are blank Enter the values you need to create a new record.
In this example, you create a new supplier record.
17. On the last row of the Query Results grid, the new record displays.
10.2.700 169
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
18. If you want to save this change to the database, click the Update button. The new supplier record is now
created. To verify the update to the database was successful, click the Get List button again to retrieve the
updated DB results.
19. If you created custom actions for the updatable query and then used the Updatable BAQ Method Directives
program to set up conditions linked to this action, you can test this directive. To do this, first select the
custom action you want from the drop-down list and click the Run Custom button.
If the updatable BAQ directive is set up correctly, the Business Process Management (BPM) condition and
its subsequent actions run as expected.
170 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Where Used
Use the Where Used sheets to review all the items that use the current query. The information on these sheets
helps you decide if you should modify the current query, delete the query, or create a new query.
Be careful if you decide to modify the query: any changes impact other applications that use this query.
If you attempt to delete a query that is in use, a warning message displays verifying whether you want to continue
deleting the query. Typically, you should not delete any query in use unless the BAQ is obsolete or no longer
needed. After you delete the query, you should remove or update the dashboard, BAQ report, or other items
that previously used it.
1. Navigate to the DashBoard List sheet to review which dashboards use the current query.
Dashboards are flexible, powerful tools that provide easy access to critical information in a real-time
environment. In addition to the standard dashboards provided with the application, you can also create
custom dashboards. Custom dashboards can replace the need for workbenches, trackers, ShopVision reports,
10.2.700 171
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
ad hoc reports, and business intelligence reports. For more information on how to create a dashboard,
review the Dashboards chapter.
2. Navigate to the Quick Search List sheet to review which quick searches use the current query.
The Quick Search functionality is a dynamic tool you use to create configurable searches you can then use
within your own user account or share publicly with other user accounts - improving the productivity of
searches. For examples of how to use this functionality, review the Searches chapter.
3. Navigate to the BAQ Report List sheet to review which BAQ reports use the current query.
Use the BAQ Report Designer to turn a Business Activity Query (BAQ) into a report. Through the BAQ Report
Designer, select a query as the base for a report, and to define the option fields, filters, and sort by options
that display on the report interface. Once you have the report layout complete, add it to the menu for users
to access. For more information on this functionality, review the BAQ Report Designer chapter.
4. Navigate to the Report List sheet to review the report data definitions that use this query as data source.
You can use a business activity query as a data source for report data definition. Report data definition is
used to create and edit the table structure of each report. It defines report's main attributes and identifies
the tables and fields that you can display on the report. For more information on using report data definitions,
review the Report Data Definition topic in Epicor ERP Implementation Guide.
5. Navigate to the Business Activity Query List sheet to see any references of the selected query to another
queries.
You can link a business activity query as a parameter to another query. These parameters can filter data on
the query; define what values from the linked BAQ are used as parameter values. Add parameters to a query
through a criterion you set up within the Business Activity Query Designer. For more information on using
parameters, review the Specified Parameter topic earlier in this chapter.
172 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
BAQ Search
Use the BAQ Search sheet to make data from your query available to users searching for related data. Many
standard search forms throughout the application contain a BAQ sheet. This sheet provides users with the access
to BAQs you have identified through the BAQ Search sheet.
You must indicate the query as Shared (on the General sheet)
before users can access this BAQ search in search programs.
You cannot use system queries on the BAQ Search sheet. If
you want to use a system query, create its copy first.
2. The Available “Like” Columns list contains all the fields you selected for your query on the Query Builder
> Display Fields > Column Select sheet.
4. First you highlight this column in the list of Available “Like” Columns and then click the Right Arrow button.
10.2.700 173
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. Click Save.
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.
10. The Search Results pane in the search window displays the query information. You can use the BAQ to
search for a specific part.
For examples of how to use this functionality, refer to the BAQ Searches section in the Searches chapter.
Comments
174 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Actions
The Business Activity Query Actions menu contains a number of tools you can use. This section describes each
of these tools.
Copy Query
The Epicor application contains system queries that control how users enter and update data throughout the
database. These queries are a great starting point for creating your own modified queries. Although you cannot
change a system query, you can copy a system query, rename it, and modify this copied query as you need.
You use the Copy Query option to duplicate an existing query.
1. Click the Query ID button to search for the query you are going to copy.
2. In the Query Search window, click the Search button and select the query that you are going to copy.
4. Click OK.
5. Notice the System. No Save. In Use icon displays. The icon indicates the selected query is a system query
that cannot be edited. It also indicates this query is used by a program, report, or owned by another author.
10.2.700 175
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. In this example, the system zContactTracker01 query is used on a quick search. You can find the specific
dashboard and quick search that contains this BAQ on the Where Used sheets.
7. You want to use this query as a base for a new query. From the Actions menu, select Copy Query.
8. In the Query ID field, enter the new name for the copied query. Be sure to enter an identifier that is different
from the ID listed in the Copy From section.
176 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
11. The message displays, indicating the query was copied successfully. Click OK to close the message.
You can now add tables, new display fields, calculated columns, make the BAQ updatable, and so on to the
copied query.
Export BAQ
Use this command to save the query definition. Once you select the query you want to export, you can export it
to a folder you specify during the BAQ export. You typically use this option to create a backup of your BAQ or
if you want to use or analyze the query on another installation. If needed, you can import it back into the
application.
This process only exports the query definition, not the data.
The Business Activity Query Export Process program, discussed
later in this chapter, can export the query data.
10.2.700 177
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Once you have a query in focus, from the Actions menu, select Export BAQ.
3. In the Description field, you can change the current description of the query.
4. Click the browse button next to the File field to find and select the folder that will contain the exported
BAQ. You need to select the directory path and enter the filename - for example,
c:\Users\User\Documents\MyContactQuery.baq.
5. For updatable BAQ utilizing events inside Epicor Service Connect workflows, you can select the Export SC
Credentials check box. The ESC credentials used when the BAQ executes are exported along with the BAQ
definition.
178 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. The Export process messages field details the results of the export.
8. If the export is successful, the “Query export finished with success” message displays.
9. Click Close.
Import BAQ
Once you have exported a version of a query, you can use the Import BAQ option from within the Business Activity
Query Designer program to pull the query definition back into the application.
To use the Import BAQ command to import a query:
10.2.700 179
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Click the Import File button to find and select the BAQ you wish to pull into the application.
3. Enter the New Query ID. In this example, you import the MyContactQuery–Rev2 query.
This field displays in the read-only mode when you import multiple queries.
4. Select the Show in Designer check box to immediately load this query into the Business Activity Query
Designer program.
This option is disabled when you import multiple queries.
6. The Import process messages field details the results of the export.
180 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Done!
7. If you are importing an updatable BAQ configured to utilize events inside ESC workflows, the following
dialogs display. First, on the Select Epicor Service Connect Server window, you are asked to specify BAQ
runtime credentials.
8. All fields on this form are filled with data coming from the exported uBAQ definition. If the query was
exported without ESC credentials, the Use Company Default Server option is selected by default.
9. Click Test Connection and verify the credentials you chose are valid.
11. Secondly, you are presented with the Logon to Service Connect window.
This window only displays if Show in Designer check box is selected while importing the query.
The credentials you enter on this window are specifically used for the WF Design. These credentials are not
saved with the query, they are only stored until the BAQ Designer form is opened. By default, ESC credentials
you selected on the Select Epicor Service Connect Server window are offered.
10.2.700 181
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
13. If the import is successful, the “Query Import finished with success” message displays.
182 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Change Author
When a query is created, only the author of the query can modify it. To give another user rights to modify a
query they did not create, use the Change Author command to assign a new author to the query. The Change
Author command is only available when you are the author of the query.
To give another user access to your query:
3. The name of the current BAQ owner displays in the Author field.
4. Click the drop-down list to select the new author of the query.
5. The new author’s User ID displays within the Change Author window. In this example, you assign AARON
to become the new BAQ author.
10.2.700 183
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. Notice the Other owner. No Save red icon indicates you no longer can save changes to this query.
To complete the updatable BAQ, use the Run BPM Designer command to set up how the BAQ interacts with the
business object's methods. Business Objects contain the code that calls a database, sending current data to a
custom dashboard for display, or populating the database with new data.
184 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. When you finish creating your updatable BAQ method directives, exit the program.
For more information, review the Updatable Business Activity Query section discussed earlier in this
chapter.
10.2.700 185
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Use the Define Custom Action command to create action placeholders available for use with the business activity
query (BAQ).
186 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. Enter an ActionID. This identifier defines the custom action within the updatable BAQ.
5. Enter an ActionLabel. This value defines how the action displays on buttons within the dashboard.
7. Continue to add the custom actions you need. When you finish, click OK.
The custom actions you add through this functionality are placeholders you can then leverage within the Updatable
BAQ Method Directives program. You use this program to create conditions that monitor these custom actions.
When a user enters data which matches the condition, the condition runs th e specific actions linked to it, like
validating data or displaying an informational message.
For more information, review the Updatable Business Activity Query section discussed earlier in this chapter.
Define Parameters
Use this option to create alternative query parameters. You can then evaluate table or subquery columns against
these parameters when building query criteria. These parameters can be nearly any value you need.
You can also use parameters to display customized method arguments for use in Business Process Management
(BPM) directives.
The query text contains references to arguments using this format: @arg_name
Example
10.2.700 187
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Execution Settings
Use the Execution Settings command to modify execution parameters of the selected BAQ.
You can set up paging parameters to indicate how the BAQ should get a sub-selection of data from a record
set, specify the longest time in which the query can run, or supply SQL statements, clauses, and keywords to
modify the resulting SQL syntax.
If you need to break the returned data into several pages:
• make sure the PageSize is set to a positive number equal to the number of rows you want to display on each
page. Otherwise, if PageSize is set to default 0, the paging is not applied.
• note that paging applies starting from the page number specified in the PageNum setting.
188 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
The table below lists the execution values you can define.
PageSize
The value in this field specifies how many rows per page are retrieved in the result set.
The available values include:
• 0 - Paging is not used.
• Any positive number - Specifies number of rows per page.
PageNum
The value in this field specifies the page number user wants to get. The default value is
1.
Be aware that if you for example, set this value to 10, but the BAQ only returns 3 pages
of data, an empty result set displays.
PageCount The value in this field specifies how many pages of data the query returns. By default,
PageCount is set to 1 meaning that the returned data is displayed on a single page. You
can set this value to any positive number greater than 0.
PagingMethod
The value in this field specifies the method used to retrieve data from the datasource.
The available values include:
• Auto - This is the default paging method. When selected, the DynamicQuery tries to
automatically select the most appropriate paging method, supported by BAQ definition
and database engine.
• Simple - When a query executes, its results return through DbDataReader, but only
required page is loaded to the result table. This paging should work for any database,
so use it explicitly if Auto method does not work for some reason.
NeedTotal
This field specifies if total number of rows in the query is received (without paging). If this
flag is set to True, the ExecutionInfo table in the result dataset, returning from query
contains total number of rows.
The value in this field should be set to False whenever possible to reduce the server
load.
Where
Setting name of additional conditions in SQL notation which are applied against results
table. Only display fields and BAQ/SQL constants be referenced. You can use where
statements of any complexity including and/or concatenations. If ExecutionFilter table
contains any conditions then they will be applied before this ‘where’ condition.
Make sure you reference fields using the BAQ Alias notation in the following format:
TableName_FieldName.
Example ABCCode_Company =
'EPIC06'
10.2.700 189
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Example ABCCode_ABCCode,
ABCCode_Company
Having
Setting name for statement that appears in the HAVING clause in addition to query
settings.
Make sure you reference fields using the BAQ Alias notation in the following format:
TableName_FieldName.
OrderBy
Setting name for comma-delimited list of fields by which you want sort the query result.
Optional direction can be specified in SQL notation (ASC/DESC).
Make sure you reference fields using the BAQ Alias notation in the following format:
TableName_FieldName.
GroupBy
Setting name for comma-delimited list of fields by which you want to sort query results.
Make sure you reference fields using the BAQ Alias notation in the following format:
TableName_FieldName.
Example ABCCode_Company
SQLServerDateFormat
This setting adds SET DATEFORMAT call at the beginning of the query. This setting should
only be used MS SQL Server.
The available options include:
• mdy (month-day-year) - default option
• dmy (day-month-year)
• ymd (year-month-day)
Transaction Isolation
This setting sets transaction isolation level which controls the locking and row versioning
behavior of Transact-SQL statements issued by a connection to SQL Server.
The available options include:
• NotSet - No Transaction Isolation specified by the BAQ engine. When the query
executes, the default Transaction Isolation Level specified in the corresponding DB
provider is used. This option is set by default.
190 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
queryMaxResultSet
Specifies maximum number of rows that will be returned by the dynamic query.
queryTimeOut
By entering a value in this field, you define the database server command timeout before
terminating the attempt to execute a command and generating an error.
Persist in Query
All execution settings can be flagged as persistent or not.
If the check box is clear, any specified settings will apply to the current BAQ session only,
until the BAQ form is closed.
If the execution setting is flagged as persistent, it will be used each time the BAQ runs.
If a BAQ supplies some execution setting on execution, while the same persistent execution
setting exist, then the first one has higher priority.
There are two parameters that are always persistent - QueryMaxResultSet and
queryTimeout; these are stored in the database with the query. All other execution settings
can be persistent or not.
10.2.700 191
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
RemoveTestRowLimit
This setting controls if the BAQ Designer is allowed to return more than 10000 rows while
testing BAQs.
For performance reasons, this parameter should be set to it's default False value
whenever possible.
This parameter has no affect on another query limits you may specify; it only controls the
data retrieval limit while testing BAQs.
ExecutionTraceLevel
This setting option does not display in the drop-down and needs to be typed in manually.
Add this setting with any value - for example, true, or 1, etc. to make the BAQ return
additional data about query execution. You can use this data for BAQ performance analysis.
The following additional performance counters get included into the query output:
• QueryPreparationTime
• SQLExecutionTime
• DataFetchTime
• TotalRows
192 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Use the Get Query Execution Plan to retrieve and save the .sqlplan execution file. You later open this file in
the SQL Server Management Studio to examine the query execution.
2. In the Save SQL Server Query Execution Plan window, you can specify the name and the location where
you want to save the .sqlplan file.
By default, the file is named using the following format: <QueryID>.sqlplan
10.2.700 193
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. Click Save.
5. Once the file is saved, open it using the SQL Server Management Studio for further analysis.
194 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Use this action to change the Security Code of system Business Activity Queries (BAQs) and Updatable BAQs
(UBAQs).
1. In the Business Activity Query Designer program, open a system BAQ - for example, COM-CustContacts.
10.2.700 195
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. Type in or browse and select the Security Code you wish to apply to the system BAQ/UBAQ.
Click Reset to default to change the Security Code to its default system value.
4. Click OK.
The updated Security Code is applied to the BAQ/UBAQ immediately, you do not need to save the changes
in the program.
196 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Run the Business Activity Query Export Process to export the query data from your database and store it in a
personal archive directory. This data can then be used on an ASP page, or imported to Microsoft® Excel® for
analysis and publishing.
Use the Business Activity Query Export Process program to export query data through either the .xml or .csv file
formats. You can export this data each time you launch this program. You can also set up the export so that it
automatically runs each time you launch your Startup Tasks.
Menu Path: System Management > Business Activity Queries > BAQ Export Process
10.2.700 197
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
1. Click the Query ID button to search for and select the query to export.
2. From the Output Format drop-down list, select the export format you want to use. You can choose either
XML or CSV file formats.
3. Enter the Output Filename for the exported query. By default, this file is automatically saved on the server
within the EpicorData > Processes > <UserName> directory - where <UserName> is the name of the
current user logged into the application. The may look as follows: C:\EpicorData\Companies\EPIC
06\Processes\MANAGER. The location of this data directory is specified in System Agent Maintenance.
You can override the default output location by exporting the file to a custom location you define. It is
allowed to use:
• Relative paths (root folder level only), for example, temp/filename.csv
• Network paths, for example \\server\share\folder\filename.xml
The correct file extension is attached during each export. If you select that the output will be an .xml file,
the .xml extension is automatically added to the file name.
If you don't have direct access to the server file system, such as with SaaS and Early Access, use the Server
File Download utility. It transfers one file at a time from one of three directories on the server: Company,
User, or Reports to the client. Specify the file type, select the file, and then browse for a path for the
download. This program is found in System Management > Schedule Processes.
4. For CSV output format, you can enter the Text Delimiter. For example, if you place a semi-colon (;) in this
field, this character separates the data in the exported file.
5. For CSV output format, if you want to display field labels in the export file, select the Output Labels check
box.
198 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. From the Schedule drop-down menu, select a schedule you want to use.
Example
You can select the Startup Task Schedule from the
Schedule list and select the Recurring check box. This way
you export this query each time you run your startup tasks.
Results of the BAQ Export Process reports are reported in the System Monitor log.
Within the Epicor Administration Console, several application server settings are available for use with BAQ
functionality. You can restrict how business activity queries generate results. This can help you avoid performance
issues caused when BAQs process large amounts of data. You can also indicate if BAQ database calls should be
recorded in the server log.
1. You launch the Epicor Administration Console from your server machine. Depending on your operating
system, you launch this tool in different ways:
• If you are on Windows SQL Server 2008 R2, click Start > All Programs > Epicor Software > Epicor
Administrative Tools > Epicor Administration Console.
• If you are on Windows SQL Server 2012, press the <Windows> + F button to display the Charms bar;
from the Apps screen, select Epicor Administration Console.
10.2.700 199
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. From the tree view, expand the Server Management node and Epicor Server node.
4. Now from either the Action menu or the Actions pane, select Application Server Settings.
5. For the BAQ Query Max Result Rows field, leave the default setting at 0, indicating there is no row limit.
If you have a BAQ that is returning a large number of rows and is affecting performance, enter a value
(number of rows) in this field to limit the number of rows returned. This is similar to using the TOP clause
in SQL.
If you do limit rows, you may not see a record you are expecting. Instead of entering a value here, consider
adding or adjusting criteria to your BAQ to make it more efficient.
6. Now in the BAQ Query Timeout field, 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.
The default value is 0, indicating there is no limit. By entering 900, you allow queries to run 15 minutes
before they time out.
200 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. Within the Standard Logging information, select the BAQ Logging check box to record Business Activity
Query (BAQ) database calls.
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.
By selecting this check box, you enable the following trace flag in the trace.config configuration file:
<add uri="trace://ice/fw/DynamicQuery" />
As a result, the server log records the following information:
Node Description
QueryID Displays a BAQ ID.
CompanyID A company, under which the BAQ is executed.
SQLExecTime Time spent on executing query's SQL statement on an SQL server.
DataFetchTime Time in milliseconds spent on reading result from an SQL Server and
preparing Result dataset.
PagingMethod If paging is used, displays the name of a paging method. (Simple, Partition,
Offset, Auto)
PageNumber If paging is used, displays the number of requested page.
PageSize If paging is used, displays the size of a page.
TotalTime Total time in milliseconds spent on query processing, including
preparation, execution, fetching data and finalization.
TotalRows Displays the number of rows in a result set.
RowLimitReached Presented if BAQ Query Max Result Rows setting is enabled in Application
Server Settings. If a query result set hits this limit; this node displays the
current limit setting value.
Example
10.2.700 201
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
A BAQ (Business Activity Query) info zone is an embedded query you can link to a specific field on a program
interface. When you activate a BAQ info zone, it displays as a linked tooltip window. The data that populates
this window depends on both the business activity query and the current value, if any, within the linked field.
After you create or modify the BAQ to use for the BAQ info zone, you link the BAQ to a specific field by either
using Extended Property Maintenance or embedding the BAQ info zone in a customization. When you launch
the program that contains the customized field, you see a BAQ info zone indicator on the field. You can then
modify the color used to display this indicator and define a shortcut key combination that activates the BAQ
zone. You define these personalization features in the Options window; you can access this window from the
Tools menu.
1. If a field is linked to a BAQ zone, a zone indicator displays next to the field.
2. Hold your mouse over the zone indicator; a tooltip window displays.
202 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. This BAQ zone window populates with data. The BAQ zone uses both the query and the field value, if any,
to generate its data results. In this example, the Part Number field has a zone indicator that displays a
graphic file for the selected part (1032KNUT).
This section contains a series of best practice methods to help you develop BAQs. If you follow these suggestions,
you will have more success creating both display-only and updatable BAQs.
Fewer Tables, Better Performance
Carefully consider how many tables you need to join in your business activity query. The functionality has few
restrictions, so, if you wish, you can create incredibly complex queries. The more tables you join on the query,
however, the slower performance the query has during runtime.
If you wish to see a lot of data at once, create a series of smaller BAQs and then display them together on the
same dashboard. If you need to create a very complex view of your data, however, consider building an executive
dashboard instead. Both the dashboard and executive dashboard features use BAQs as building blocks for
gathering and displaying data, but contain additional, more efficient functionality for publishing and subscribing
values between tables. Because of this, it is often better to have a series of smaller BAQs you can manipulate
through a dashboard, rather than one huge BAQ that requires a lot of processing time to pull in its data.
To learn more, review Chapter 5: Dashboards and Chapter 7: Executive Dashboards.
Start Small and Test Often
10.2.700 203
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Begin your complex query project by starting small with just one or two tables. You can then analyze the results
to find out if you are pulling in the desired data at each step through the database. You can then add more
complexity by adding another table and testing the results. By adding and testing each table and subquery, you
verify the results as you build the complex BAQ. Always be sure to build a complex BAQ in sections and then
frequently check the results. If you do not, you may pull in undesirable data, and it will be difficult for you to
determine which table is causing the problem.
Too Much Data
If you are getting more rows in your results than you expect, you may need to filter the second, using a field on
the first table. For example, you want to create a BAQ that shows when a specific operation is scheduled to run.
Because the database contains operations scheduled as What-If operations and others scheduled as actual
operations, you may get duplicate results. If you filter the JobOperDtl (job operation detail) table by using the
ResourceID field on the ResourceTimeUsed table, only resources assigned to operations in the actual schedule
appear in your BAQ results.
Use Calculated Fields
If you have similar data placed in different columns because of different record types, use a calculated field to
total these amounts for display within a single column. For example, if you are creating a query to review labor
in your manufacturing center, each employee will log time as indirect labor and direct labor. To find out the total
amount of labor, use a calculated field that contains a formula for totaling the indirect and direct labor values.
Outer Joins – When to Use
The Outer Join table relationship is useful in situations where you want to see everything from the first table and
find out what records are not linked to these records in the second table. For example, you want to see which
customers have recently ordered products from your company. To do this, you build a query that outer joins the
Customer table with the OrderHed (sales order header) table. All the customer records appear alongside all of
the sales order records. You can then see in the BAQ the customers that currently do not have sales orders placed
with your company.
Sorting Performance
Sorting data by a selected column is a powerful feature, but be aware that some significant processing time may
be required to display the reordered results. This situation is especially true when you sort a large amount of
data. The query tool has to first return all of the records into memory before it can re-order their sequence through
the selected column. All of this processing occurs on the server, so the data calls need to move across the network
before they arrive at your client workstation. So if you sort on a large amount of data, be patient – the reordered
results are on their way.
Case Studies
This section of the chapter explores some step-by-step case studies. Each case study explores a different aspect
of the business activity query (BAQ) functionality.
This BAQ generates a summary of each shop employee’s total labor and burden hours. During this case study,
you join the Employee Basic (EmpBasic) table from Shop Employee Maintenance with the Labor Detail (LaborDtl)
table from Labor Entry. You then filter the results against a specific date and create calculated fields to generate
the total labor and burden hours.
204 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
1. Click New.
4. Select the Shared check box to indicate other users within the current company can use this query.
10.2.700 205
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. The Erp.EmpBasic table displays. Drag and drop it onto the grid.
8. Click the Connected Only Tables button. This limits the tables so that only tables linked to the EmpBasic
table display on this list.
206 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
9. The Erp.LaborDtl table displays. Drag and drop it onto the grid. The two tables automatically link.
10. You want to filter the labor data based on a cutoff payroll date. Highlight the Erp.LaborDtl table.
10.2.700 207
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
14. From the Operation list, select Greater Than or Equal (>=).
15. From the Filter Value list, select the specified constant option.
17. The Specify a Value window displays. In the Value field, enter the date you need.
Select the columns on both the tables you want to view in your results.
1. Navigate to the Display Fields > Column Select sheet. Use this sheet to define what columns display on
the query results.
208 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. Expand the EmpBasic node and move Name into the Display Column(s) area.
4. Select the Group By check box to group BAQ results by each employee.
5. Add two calculated fields to the query results. Click the Calculator button.
10.2.700 209
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. Click New.
9. From the Data Type list, select decimal. This indicates the field accepts decimal places within its values.
10. You are creating a calculated field that totals each employee’s labor hours. In the Functions area, expand
the Aggregate node.
11. Select the Sum(x) option. Notice the function syntax displays in the Editor field. This function adds together
all values the query finds in a specific column. In this query, it totals the labor hour values linked to each
shop employee record.
12. In the Fields area, expand the LaborDtl node and double-click LaborHrs.
14. Repeat these steps to create another calculated field that totals burden values for each shop employee. Use
the Sum(x) function and select the BurdenHrs field.
17. Notice your calculated fields are included within the Display Column(s) section. If you wish, click inside the
Label column to modify the text that displays for each column.
210 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
18. You are ready to test the query. Navigate to the Analyze sheet.
10.2.700 211
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Because you created calculated fields, the total labor and burden hours for each employee displays in the Query
Results grid.
This BAQ displays all the employees who are currently clocked in but not clocked out on operations. During this
case study, you join the Labor Head (LaborHed) table to the shop employee (EmpBasic) table, and then filter the
results by employees that still have an active labor transaction running within the database. You also sort the
results by employee.
212 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. Select the Shared check box to indicate other users within the current company can use this query.
10.2.700 213
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. Search for and place the Erp.LaborHed and Erp.EmpBasic tables on the canvas.
7. These tables have a relation defined in the schema, so they automatically link.
8. You want to filter the employee data based on the employees who are still clocked into the application.
Highlight the Erp.LaborHed table.
214 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
13. From the Filter Value list, select the specified constant option.
15. The Specify Value window displays. In the Value field, enter Yes. This indicates only employees who are
currently clocked in display in this query.
Select the columns on both the tables you want to view in your results.
10.2.700 215
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. Move the following columns from the Available Columns area to the Display Column(s) area:
• EmpBasic_Name
• EmpBasic_EmpID
6. Move the following columns from the Available Columns area to the Display Column(s) area:
• LaborHed_ActualClockinDate
• LaborHed_ActualClockInTime
• LaborHed_ActualClockOutTime
• LaborHed_ActLunchInTime
• LaborHed_ActLunchOutTime
• LaborHed_ActiveTrans
216 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
8. You want the results to sort by each employee’s name. Expand the EmpBasic node.
11. You are ready to test the query. Navigate to the Analyze sheet.
10.2.700 217
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
All the employees who are currently clocked into the database display in the Query Results grid.
This case study demonstrates how to create a simple updatable query to create or update supplier records.
218 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 219
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
10. Move the following fields into the Display Column(s) section and change the field labels as follows:
• Vendor_Company
• Vendor_VendorID
• Vendor_Name
• Vendor_VendorNum
• Vendor_Address1
• Vendor_City
• Vendor_State
• Vendor_ZIP
• Vendor_Country
220 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. Click the Updatable column header check box to mark all fields in the grid as updatable.
10.2.700 221
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. In the Suggested business objects section, select the Erp.Vendor object and click OK.
9. In the Tables to update pane, ensure the Vendor table is becomes selected.
1. Click the Get List button to test whether the updatable BAQ can pull in data from the database.
222 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. You are warned this test may launch BPM directives that update the database. Click Yes.
3. The Query Results grid populates with data. You now can test the BAQ to find out if you can update
existing records.
10.2.700 223
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. The Fields window displays. This window contains all of the fields you indicated were updatable on the
Update > General Properties sheet. In the Fields window, enter a new value in one of the fields.
In this example, you modify the address of a supplier record.
7. The record you updated is now highlighted within the Query Results sheet.
224 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
8. If you want to save this change to the database, click the Update button.
9. The record is now updated. To verify the update to the database was successful, click the Get List button
again to retrieve the updated DB results. You can also open a specific program that should reflect your
changes, for example, Supplier Maintenance and verify your changes there.
10. If you want to add new records to the updatable BAQ, click the Get New button.
11. A blank row displays on the Query Results list. Double-click the empty row.
10.2.700 225
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
12. The Fields window displays. Initially, all the fields are blank Enter the values you need to create a new record.
In this example, you create a new supplier record.
14. On the last row of the Query Results grid, the new record displays.
226 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
15. If you want to save this change to the database, click the Update button.
16. The new supplier record is now created. To verify the update to the database was successful, click the Get
List button again to retrieve the updated DB results.
10.2.700 227
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
In this case study, design an updatable query to view and update sales order header data.
Throughout this example, explore various tools such as client-server tracing, raising BPM events using updatable
columns and calling Business Object methods from within BPM directives. You also understand the concept of
using directive level variables, to pass and receive data from Business Object calls.
228 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. Search for and place the following tables on the designer canvas:
• Erp.OrderHed
• Erp.Customer
• Erp.ShipTo
7. Now specify relationships between the tables. Accept the default relationship between the Erp.OrderHed
and Erp.Customer tables.
8. When the Ship To customer is selected on the order header, you want to display the information directly
from the Ship To table. To do so, first delete the relationship between the Erp.Customer and Erp.ShipTo
tables.
10.2.700 229
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. Select the newly created link between the two tables.
230 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
12. On the Table Relationships pane, create new relationship between the two tables using the following
fields:
10.2.700 231
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Select the following fields in this order and move them to the list of Display Column(s).
To easily locate the below fields, you can sort columns alphabetically.
• OrderHed_Company
• OrderHed_OrderNum
• Customer_CustID
• Customer_Name
• Customer_Address1
• Customer_Address2
• Customer_City
• Customer_State
• Customer_Zip
• OrderHed_CustNum
• OrderHed_BTCustNum
• OrderHed_ShipToCustNum
• OrderHed_PONum
• OrderHed_ShipToNum
• ShipTo_Name
232 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
• ShipTo_Address1
• ShipTo_Address2
• ShipTo_City
• ShipTo_State
• ShipTo_Zip
• OrderHed_NeedByDate
• OrderHed_RequestDate
• OrderHed_FOB
• OrderHed_ShipViaCode
• OrderHed_TermsCode
• OrderHed_DiscountPercent
3. Notice the Customer and Ship To table fields share the same labels. In order to distinguish between them
on a dashboard, modify the Ship To field labels in the following way:
Alias Label
ShipTo_Name ShipTo Name
ShipTo_Address1 ShipTo Address
ShipTo_Address2 ShipTo Address2
ShipTo_City ShipTo City
ShipTo_State ShipTo State/Prov
ShipTo_Zip ShipTo Postal Code
10.2.700 233
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. Now specify for which fields you want to allow data updates by selecting the Updatable check box. In this
example, select the following fields:
• Customer_CustID
• OrderHed_CustNum
• OrderHed_BTCustNum
• OrderHed_ShipToCustNum
• OrderHed_PONum
• OrderHed_ShipToNum
• OrderHed_NeedByDate
• OrderHed_RequestDate
234 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
• OrderHed_FOB
• OrderHed_ShipViaCode
• OrderHed_TermsCode
• OrderHed_DiscountPercent
4. On the Select Business Object window, the application suggests several Business Objects you can use to
perform database updates.
7. At the bottom, notice the Query To Object Column Mapping sheet. This sheet defines how data is pulled
from the uBAQ to the Business Object table.
10.2.700 235
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. The Object To Query Column Mapping sheet defines the opposite mapping, it specifies how data is
returned to the BAQ from the Business Object.
1. First, investigate what happens when you enter a customer ID on the form. Click New > New Order.
236 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. To analyze the client - server activity, launch the Tracing Options Form. In this example:
• If you use the application with the Modern Home Page style, launch the Tracing Options Form from
the Application Bar at the bottom of the Home Page.
10.2.700 237
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
• If you use the application with the Kinetic Home Page style, launch the Tracing Options Form by selecting
Tracing Options from the overflow menu at the top right corner of the Home Page.
4. On the Tracing Options Form, select the Enable Trace Logging check box.
By selecting this option, all calls made by the user interface to the server now automatically record within
the tracing log.
238 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. Click Apply.
6. Navigate back to the Sales Order Entry form. In the Customer field, delete Addison and type Dalton.
Then press Tab.
10.2.700 239
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
MethodName Parameters
OnChangeofSoldToCreditCheck
<parameter name="iOrderNum"
type="System.Int32"><![CDATA[0]]></parameter>
<parameter name="iCustID"
type="System.String"><![CDATA[DALTON]]></parameter>
<parameter name="cCreditLimitMessage"
type="System.String"><![CDATA[]]></parameter>
<parameter name="lContinue"
type="System.Boolean"><![CDATA[False]]></parameter>
<parameter name="ds" type="SalesOrderDataSet">
Each Business Object method uses parameters to provide the expected behavior. Notice the above methods
use the same dataset (ds) parameter called SalesOrderDataSet. Later in this workshop, you replicate this
behavior by calling these methods from within a BPM workflow.
240 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
9. Now examine what happens when you change the default ShipTo location. Launch the Tracing Options
Form again and click Clear Log.
10.2.700 241
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
10. Change the ShipTo location to Plant2 and notice the address changes.
11. Switch back to the Tracing Options Form and click View.
242 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
12. In the log, verify the ChangeShipToID method was called. You can ignore other system methods, if present
in the log. Notice the method again uses a single ds (dataset) parameter called SalesOrderDataSet.
MethodName Parameter
ChangeShipToID <parameter name="ds" type="SalesOrderDataSet">
10.2.700 243
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
13. The last process you want to track down is selection of the Need By date and automatic assignment of the
Ship By date. Invoke the Tracing Options Form and Clear Log.
244 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
15. Notice the Need By date you selected becomes the default Ship By date. This DB field is
OrderHed.RequestDate.
This date is used as the default date for all sales order lines.
16. View the Tracing Log. Verify the method that was called this time was ChangeNeedByDate. This method
uses two parameters - ds (dataset) SalesOrderDataSet and a TableName parameter of string type. Notice
the TableName parameter is set to OrderHed.
MethodName Parameters
ChangeNeedByDate
<parameter name="ds" type="SalesOrderDataSet">
<parameter name="cTableName"
type="System.String"><![CDATA[OrderHed]]></parameter>
10.2.700 245
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
17. On the Tracing Options Form, clear the Enable Trace Logging check box.
246 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 247
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. Since you want the uBAQ to perform additional actions after values in certain field change, you need to
specify which fields will raise BPM events. In this example, select the Raise Events check box for the following
fields:
• Customer_CustID
• OrderHed_ShipToNum
• OrderHed_NeedByDate
5. For the Terms Code field, you want to allow users to use a drop-down menu and select one of the available
codes customers will pay for an order.
In the left pane, select OrderHed_TermsCode.
7. In the Data from field, accept the default option Custom Values.
8. In the Values Editor pane at the bottom, define what values you want to display on the drop-down list.
Use the Add Value icon to create new records.
248 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 249
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
250 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. Based on the information you specified on the BPM Update Processing tab, the BAQ Designer generates
the Base Processing directive against Update method. To see the code automatically generated by uBAQ:
6. Expand Ice.EPIC06/SOHeaderUpdate.Update > Base Processing and click on the directive named
##BASE##.
11. The Enter Custom Code window displays. Notice the code governs the update process by preparing data,
specifying which columns were selected as updatable, calling UpdateExt method and so on.
12. Exit the Enter Custom Code window and close the BPM Workflow Designer without saving any changes.
13. In the Methods Tree-view, notice the Base Processing directive was also generated for the GetNew method.
This directive was generated as you allowed creating new records through this BAQ by selecting the Allow
10.2.700 251
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
New Record option on the Update > General Properties sheet. This directive is also named #BASE# name
and it contains a C# code with field assignments for new rows.
1. In the Updatable BAQ Method Directives window, select the FieldUpdate method.
252 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 253
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. When you build a complex updatable query, a common practise is to test if BPM is able to identify a certain
event was called. This can be done as follows.
In the BPM Workflow Designer, place the Show Message action on the surface below the Start item.
9. Delete the default text in the Editor pane and enter Field Name =.
254 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 255
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Test Events
Now verify raising of BPM events works.
256 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. Double-click on any existing row to launch the Fields window. This window contains all of the fields you
indicated were updatable.
4. Notice, that for Customer_CustID, OrderHed_ShipToNum and OrderHed_NeedByDate fields that were
selected to raise BPM events, two additional buttons display. The V button performs the FieldValidate BAQ
method directives; the U button performs the FieldUpdate BAQ method directives described for the field.
5. To verify raising of events works, in the Customer_CustID field, enter a customer other than current. For
example, enter Dalton, Addison or Barriston.
7. Notice the Information Message displays and the field that raised the event, in this case, Customer_CustID
is identified.
You will later use this logic to create several branches within the BPM workflow based on which field called
an event.
8. Click OK to the message and close any other potential messages reported by the method.
10.2.700 257
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
10. Navigate back to the Workflow Designer. On the Update > Update Processing sheet and click the BPM
Directives Configuration button.
258 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
13. Since you verified raising of events works, delete the Show Message action.
Remain in the workflow.
1. First, you need to make sure certain actions are performed only when a CustomerID is changed. To do so,
place the Conditon element below the Start item. Leave an extra space between the Condition and the
Start for another workflow item created later in the process.
10.2.700 259
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Now configure the Condition. In the pane at the bottom, click New and select the pre-built condition
statement:
The specified argument/variable is equal to the specified expression
9. In order to quickly identify the purpose of each workflow item, you can customize it's name. Double-click
the Condition name heading and type Cust ID?.
260 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Configure BO Call
By analyzing the Sales Order tracing log, you found out that three methods - OnChangeofSoldToCreditCheck,
ChangeSoldToId and ChangeCustomer are called when a CustomerID is changed. Revisit the Analyze Tracing
Log topic, if needed. Now call these methods from within the workflow. Start the process by configuring the
OnChangeofSoldToCreditCheck method.
1. Place the Invoke BO Method action below the Cust ID? Condition. This action is found in the Callers
category.
10.2.700 261
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. Click the second specified to launch the Setup Method Parameters window.
6. Notice the two in (input) parameters pass data into the method. These are required parameters the method
call expects. In both cases, you will supply this data from the internal ttResults table the uBAQ uses.
7. For the iOrderNum parameter, invoke the Binding drop-down list and select expr: specified expression.
8. Click the link to launch the launch the Specify C# expression window. Use this window to compose an
expression assigned to this parameter.
262 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. Double-click on the OrderHed_OrderNum field. Verify the Editor pane now reads
ttResultsRow.OrderHed_OrderNum.
12. Similarly, create another expression for the iCustID parameter and set it to ttResultsRow.Customer_CustID.
10.2.700 263
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
13. Now specify the two out (output) parameters which return data from the method call. Business Object
methods do not require any data from the parameters of this direction.
In this example, for both the cCreditLimitMessage and IContinue parameters, select [ignore].
14. Notice the last parameter of this method named ds (dataset). This parameter uses the INPUT-OUTPUT
direction, which indicates the method receives data from this parameter and potentially returns the updated
data into the variable of the same type. Also, notice the required type is SalesOrderTableSet.
15. For the ds SaledOrderTableSet parameter, click Binding and select create new variable.
16. In the Create new variable window, notice the type of variable required by the Sales Order BO defaults
in. In this case, the type is Erp.Tablesets.SalesOrderTableset.
For Name, enter SalesOrderTS.
17. Click OK in both Create New Variable and Setup Method Parameters windows.
18. To identify which method is called through this action, change the Invoke BO Method heading to Credit
Check.
264 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
1. In this example, the TableSet variable prepares data for all Business Object Methods used across the workflow.
Click the Fill Table By Query action and place it right below the Start item.
3. First, design a BPM query. Click designed to launch the Compose Query window.
10.2.700 265
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. When you construct the query, you can reference both in-memory tables, known by the Business Object,
such as ttResults and standard database tables such as ERP.OrderHed.
As data is currently in the ttResults table, place this table on the canvas.
6. To finalize the query, click the Display Fields tab and select the columns you want to display in the result
set.
266 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 267
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
9. Now select the target in-memory table where data from the BPM Query will be inserted. In this example,
you select the directive level variable of the TableSet type you created for this directive.
In the Action phrase, click specified.
10. From the Table drop-down list, scroll down and select SalesOrderTS.OrderHed.
12. To complete the action, configure how records are mapped to the in-memory table.
Click the specified mapping link.
268 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
13. The Setup Table Mapping window displays, presenting all fields available within the SalesOrderTS.OrderHed
variable.
14. Click the Bind Automatically button. As the result, BPM Query display fields with the matching name and
type are automatically mapped to the corresponding target table columns.
10.2.700 269
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
The directive-level variable is now ready for use within the workflow.
1. First, configure the ChangeSoldToID method. Place the Invoke BO Method action below the Credit Check
action.
270 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 271
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. Notice this method uses a single parameter of SalesOrderTableset type. Click Binding and select the previously
created var: SalesOrderTS variable.
272 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
9. Similarly, configure the ChangeCustomer method. Place the Invoke BO Method action below the Change
Sold To action.
10. Click the first specified to launch the Choose BO Method window.
10.2.700 273
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
14. Same as above, this method uses a single parameter of SalesOrderTableset type. Bind this parameter to the
var: SalesOrderTS variable.
274 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
1. Place the Update Table By Query action below and to the right of the Change Customer method call
action.
10.2.700 275
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. Design a BPM query. You can then use the query rows to update the information within a target table. Click
designed to launch the Compose Query window.
276 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. As modified data is currently in SalesOrderTS.OrderHed table, place this table on the canvas.
6. You also need to retrieve data back from two additional tables used on the query. Place the following tables
on the canvas:
• Erp.Customer
• Erp.ShipTo
7. Delete the automatic link between the Erp.Customer and Erp.ShipTo tables.
8. Manually create the relationship between the SalesOrderTS.OrderHed and Erp.Customer tables using
the following fields:
10.2.700 277
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
9. Create new relationship between the SalesOrderTS.OrderHed and Erp.ShipTo tables using the following
fields:
278 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. Click the Display Fields tab and select the following columns to be included in the result set:
• SalesOrderTS_OrderHed_Company
• SalesOrderTS_OrderHed_OrderNum
• SalesOrderTS_OrderHed_CustNum
• SalesOrderTS_OrderHed_PONum
• SalesOrderTS_OrderHed_ShipToNum
• SalesOrderTS_OrderHed_RequestDate
• SalesOrderTS_OrderHed_FOB
• SalesOrderTS_OrderHed_ShipViaCode
• SalesOrderTS_OrderHed_TermsCode
• SalesOrderTS_OrderHed_DiscountPercent
• SalesOrderTS_OrderHed_NeedByDate
• SalesOrderTS_OrderHed_BTCustNum
• SalesOrderTS_OrderHed_ShipToCustNum
• Customer_CustID
• Customer_Name
• Customer_Address1
• Customer_Address2
• Customer_City
• Customer_State
• Customer_Zip
10.2.700 279
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
• ShipTo_Name
• ShipTo_Address1
• ShipTo_Address2
• ShipTo_City
• ShipTo_State
• ShipTo_Zip
12. Now select the target in-memory table where data from the BPM Query will be inserted. In the Action phrase,
click specified.
280 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
13. From the Table drop-down list, verify ttResults (queryResultDataSet.Results) defaults in.
15. Now configure how records are mapped to the ttResults table. Click the specified mapping link.
10.2.700 281
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
16. Click the Bind Automatically button to map fields from the variable to the results table.
282 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
19. Connect the Change Customer method call action to Update ttResults.
1. First, make sure this workflow branch executes when the ShipTo number is changed. To do so, place the
Conditon element to the right of the Cust ID? condition.
10.2.700 283
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
284 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. Click OK.
9. Connect the Cust ID? False exit point to the Ship To? condition.
10. Recall the method you need to use to replicate the behavior is ChangeShipToID. Place the Invoke BO
Method action below the Ship To? condition.
11. Click the first specified to launch the Choose BO Method window.
13. Click the specified to launch the Setup Method Parameters window.
10.2.700 285
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
14. For a single parameter used by the method, click Binding and select the previously created SalesOrderTS
variable.
16. Change the Invoke BO Method action heading to Change Ship To.
286 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
17. Connect the Ship To? True exit point to the Change Ship To action.
18. Again, you need to send data from the SalesOrderTS variable to the ttResults table. To do so, connect the
Change Ship To action to Update ttResults.
1. Create another condition to check if the Need By date field is updated on the form. Place the Conditon
element below and to the right of the Ship To? condition. Configure the Condition as follows:
10.2.700 287
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
9. Connect the Ship To? False exit point to the Need By? condition.
288 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. Recall the method that gets called is ChangeNeedByDate. Place the Invoke BO Method action below the
Need By? condition.
11. Click the first specified to launch the Choose BO Method window.
10.2.700 289
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
14. For the ds (dataset) parameter used by the method, click Binding and select the previously created
SalesOrderTS variable.
15. For the iTableName parameter, invoke the Binding drop-down list and select expr: specified expression.
Recall this parameter requires the OrderHed table name passed in. Create a C# expression; in the Editor
pane, enter "OrderHed".
16. Now that both parameters are configured, click OK to exit the Setup Method Parameters window.
290 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
17. Change the Invoke BO Method action heading to Change Need By.
18. Connect the Need By? True exit point to the Change Need By action.
19. Send data from the SalesOrderTS variable to the ttResults table. To do so, connect the Change Need By
action to Update ttResults.
1. The workflow is now ready for testing. Click Save and Exit to close the BPM Workflow Designer.
10.2.700 291
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
292 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. Click the Get List button and verify the query retrieves existing order headers.
4. Double-click the empty row at the bottom of the Query Results grid to invoke the Fields window.
10.2.700 293
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. Notice the default information for the customer Dalton, such as Customer Number, Ship To location and
Terms Code default in.
Now test raising of another event. In the OrderHed_NeedByDate field, select today's date.
294 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
9. Click the U button and verify the OrderHed_RequestDate automatically fills in.
11. Now test if you can create the new sales order record. Click Update and verify the operation succeeds.
10.2.700 295
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
12. Lastly, test the Ship To location change. Click Get List and double-click the new order line to invoke the
Fields window.
296 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
13. In the OrderHed_ShipToNum field, enter a non-existent ShipTo location. For example, enter Plant123.
14. Click the U button and verify the Invalid Ship To error message displays.
15. Now enter a valid ShipTo location for the customer Dalton by changing the value to Plant2.
10.2.700 297
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
16. Click the U button and verify the Field Update operation completes successfully.
17. Exit the Fields window and notice the ShipTo address on the grid is changed.
298 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
In this case study, create a BAQ that counts open, closed, and total amount of orders per customer. Create two
SubQueries that count open and closed orders and group them together by customer. The information obtained
by the Inner SubQueries is presented by the TopLevel SubQuery.
1. Click New.
10.2.700 299
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
300 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. From the list, select the Erp.OrderHed table and drag and drop it onto the canvas in the center pane.
9. Click New.
12. From the Filter Value list, select the specified constant option.
Select Columns
3. Double-click CustNum to add the OrderHed_CustNum field to the list of Display Column(s).
4. Select the Group By check box to indicate you want to group open orders by customer.
10.2.700 301
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
10. To indicate you want to count all open order records, inside the brackets, enter * (asterisk).
14. For SubQuery1 you just created, from the Type list, select InnerSubQuery.
This indicates this SubQuery becomes a nested query inside the TopLevel BAQ you create later.
302 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. On the Query Builder > SubQuery Options sheet, accept the following defaults:
Name Type
SubQuery2 InnerSubQuery
10.2.700 303
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. From the list, select the Erp.OrderHed table and drag and drop it onto the canvas in the center pane.
The BAQ Designer must create the table alias for the
OrderHed table since it is already used in the previous
SubQuery.
8. Click New.
11. From the Filter Value list, select the specified constant option.
304 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Select Columns
4. Select the Group By check box to indicate you want to group closed orders by customer.
6. Click New.
9. In the Editor pane, manually add the calculation that counts all closed orders.
count( * )
10.2.700 305
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. Search for and add the Erp.Customer table onto the canvas in the center pane.
7. Drag and drop both SubQuery1 and SubQuery2 onto the canvas.
9. Click the Erp.Customer table and drag a line to the SubQuery1 table, then release.
306 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
12. From the Customer field or any expression list, select CustNum.
13. From the SubQuery1 field or any expression list, select OrderHed_CustNum.
14. Repeat steps 8 - 13 to create a connection between the Erp.Customer and SubQuery2 tables.
10.2.700 307
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Expand the Customer node and move the Name field to the list of Display Column(s).
3. Expand the SubQuery1 node and move the Calculated_CountOpen field to the list of Display Column(s).
4. Expand the SubQuery2 node and move the Calculated_CountClosed field to the list of Display Column(s).
308 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
8. In the Fields pane, expand the Available Tables > SubQuery1 node.
11. In the Fields pane, expand the Available Tables > SubQuery2 node.
10.2.700 309
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Click Test.
The BAQ displays open, closed, and total amount of orders per customer.
This case study demonstrates how to build a BAQ that displays total value breakdown of sales for a given day.
This BAQ provides information on total values of:
• Quotes entered in the sales pipeline.
• Orders booked in the system.
• Invoices sent to customers.
310 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
You accomplish this task by creating a BAQ comprised of three SubQueries and combining their results into one
dataset.
3. In the Description field, enter Total Value of Quotes, Orders, Invoices by Date.
10.2.700 311
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. Drag and drop the following tables onto the designer canvas:
• Erp.QuoteHed
• Erp.Customer
312 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
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
Field Name SubQueryName
Data Type nvarchar
Label Document Type
Editor pane 'Quotes'
10.2.700 313
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Field Value
Field Name QuoteSum
Data Type decimal
Label Total Value
15. In the Functions area, expand the Aggregate node and double-click Sum(x).
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.
314 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 315
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. Click Save.
316 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. Navigate to the Query Builder > Phrase Build sheet and drag and drop the following tables on the designer
canvas:
• Erp.OrderHed
• Erp.Customer
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.
8. Navigate to the Display Fields > Column Select sheet and move the following columns to the Display
Column(s) list:
Column Name
OrderHed_Company
Customer1_Name
OrderHed_OrderNum
OrderHed_OrderDate
10.2.700 317
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
9. For each of the above columns, select the Group By check box.
Field Value
Field Name SubQueryName1
Data Type nvarchar
Label Document Type
Editor pane 'Orders'
318 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 319
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Field Value
Field Name OrderSum
Data Type decimal
Label Total Value
15. In the Functions pane, expand the Aggregate node and double-click Sum(x).
16. In the Fields pane, expand the Available tables > OrderHed node and double-click OrderAmt.
Verify the Editor pane displays the following calculation:
sum( OrderHed.OrderAmt )
18. Move the Calculated_SubQueryName1 column up and make it the first column in the list.
320 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. Navigate to the Query Builder > Phrase Build sheet and drag and drop the following tables onto the
designer canvas:
• Erp.InvcHead
• Erp.Customer
Accept the proposed Customer table alias.
6. Navigate to the Display Fields > Column Select sheet and move the following columns to the Display
Column(s) list.
Column Name
InvcHead_Company
Customer2_Name
InvcHead_InvoiceNum
InvcHead_InvoiceDate
7. For each of the above columns, select the Group By check box.
Field Value
Field Name SubQueryName2
Data Type nvarchar
10.2.700 321
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Field Value
Label Document Type
Editor pane 'Invoices'
Field Value
Field Name InvoiceSum
Data Type decimal
Label Total Value
13. In the Functions pane, expand the Aggregate node and double-click Sum(x).
14. In the Fields pane, expand the Available tables > InvcHead node and double-click InvoiceAmt.
Verify the Editor pane displays the following calculation:
sum( InvcHead.InvoiceAmt )
16. Move the Calculated_SubQueryName2 column up and make it the first column in the list.
322 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 323
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. At the bottom of the screen, verify the Table Criteria sheet displays.
324 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
12. From the Filter Value list, select the specified parameter option.
14. Verify the Date parameter you created is highlighted and click Select.
15. Repeat steps 7 - 14 to apply the same filter to the OrderHed and QuoteHed SubQueries. To switch between
SubQueries, use the Active SubQuery toolbar.
Use the table below for reference:
10.2.700 325
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. Click OK.
6. Right-click anywhere in the grid and select Show Group By and Show Summaries.
7. Drag the Document Type column to the pane above the grid.
326 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
11. You BAQ results are now broken down by Quotes, Orders, and Invoices with their total values for a given
day.
10.2.700 327
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
This case study demonstrates how you can use the advanced Group By expression to view total value of sales
orders and quotes per country and customer.
In order to gather correct aggregate results from more than one table in the query, the following approach is
used:
• Each table combination and aggregate calculation is performed within individual inner SubQueries.
• The whole query results are presented using the Top Level Subquery.
328 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. Accept the default relation between the tables but for the Join Type, select Right Join.
This eliminates customers who have not placed any orders to appear on the list of query results.
6. In this example, a filter is placed on the Customer table to only retrieve records from Mexico and Canada.
10.2.700 329
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. For the Display Column(s), select the Customer_Country and Customer_CustID columns.
330 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
8. Now create a calculated field that summarizes the total amount of orders placed by customers. Click the
Calculated Field Editor button.
10.2.700 331
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. In the Editor pane, create the following calculation to summarize order values:
sum( OrderHed.OrderAmt )
13. Access the Advanced Group By Clause Editor by clicking on a button found at the bottom of the screen.
332 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
14. Similar to the Calculated Field Editor, the window contains lists of available fields, functions, and operators.
You can add these items to an expression by either double-clicking them or dragging and dropping them
onto the editor window's Expression Editor field. Click Add Row to create a new expression.
10.2.700 333
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
15. At the top of the Functions node, notice the Group By category displays.
The ROLLUP, CUBE, and GROUPING SETS operators found in this category represent advanced aggregation
extensions of the GROUP BY clause.
Function Description
ROLLUP
The ROLLUP operator is useful in generating reports that contain subtotals and totals. It
generates a result set that shows aggregates for a hierarchy of values in the selected columns.
The resulting SQL syntax may look similar to the following:
SELECT a, b, c, SUM ( <expression> )
FROM T
GROUP BY ROLLUP (a,b,c);
As a result, one row with a subtotal is generated for each unique combination of values of
(a, b, c) , (a, b) , and (a). A grand total row is also calculated.
CUBE
Generates simple GROUP BY aggregate rows, the ROLLUP super-aggregate rows, and
cross-tabulation rows. CUBE outputs a grouping for all permutations of expressions in the
<composite element list>.
The resulting SQL syntax may look similar to the following:
SELECT a, b, c, SUM (<expression>)
FROM T
GROUP BY CUBE (a,b,c);
As a result, one row is produced for each unique combination of values of (a, b, c) , (a, b)
, (a, c) , (b, c) , (a), (b), and (c) with a subtotal for each row and a grand total row.
GROUPING
Specifies multiple groupings of data in one query. Only the specified groups are aggregated
SETS
instead of the full set of aggregations that are generated by CUBE or ROLLUP. The results
are the equivalent of UNION ALL of the specified groups. GROUPING SETS can contain a
single element or a list of elements. GROUPING SETS can specify groupings equivalent to
those returned by ROLLUP or CUBE. The <grouping set item list> can contain ROLLUP or
CUBE.
The resulting SQL syntax may look similar to the following:
SELECT a, b, SUM (<expression>)
FROM T
GROUP BY GROUPING SETS ((a),(b))
For more information on the above operators, review the available Microsoft® documentation, for example:
• http://technet.microsoft.com/en-us/library/bb522495(v=sql.105).aspx
• http://technet.microsoft.com/en-us/library/ms177673.aspx
• http://blogs.msdn.com/b/craigfr/archive/2007/10/11/grouping-sets-in-sql-server-2008.aspx
In this example, expand Functions > Group By and double-click the ROLLUP function. This function
generates an output that presents subtotals and totals.
16. For Group By expression fields, from the Customer table, select Customer.Country and Customer.CustID
fields, separated by a comma.
The Group By expression should now read:
ROLLUP( Customer.Country, Customer.CustID )
334 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 335
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. Accept the default relation between the tables. Same as for orders, for the Join Type, select the Right Join
to eliminate customers for whom no quotes have been created yet.
5. Again, from the Customer table, apply a filter to only retrieve customers from Mexico and Canada.
336 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. Same as before, for the Display Column(s), select the Customer_Country and Customer_CustID columns.
Create another calculated field named Total Quote that summarizes the total amount of quotes placed by
customers. This time, the expression should read:
sum(QuoteHed.QuoteAmt)
10.2.700 337
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. Click the Advanced Group By Clause Editor button to aggregate results for this SubQuery.
8. Create the same ROLLUP expression using the Country and Customer ID columns, separated by a comma.
The Group By expression should read:
ROLLUP( Customer1.Country, Customer1.CustID )
338 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 339
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. This TopLevel SubQuery will display combined results from both previously created SubQueries. Select the
Query Builder > Phrase Build sheet and click the SubQueries button.
340 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. Now it's time to select which fields will be displayed by the query. In this example, values in the Customer
ID and Coutry fields will be constructed using the SQL COALESCE syntax. The expression you create evaluates
the arguments in order and returns the current value of the first expression that initially does not evaluate
to NULL.
Click the Calculated Field Editor button.
10.2.700 341
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. Click New and enter a Field Name, for example, Cust ID.
342 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. For Data Type and Format, use the default database attributes for this field - nvarchar x(10).
9. In the Editor pane, type coalesce (). Inside the brackets, place function arguments. In the Fields pane, search
for and select both Customer ID fields from inner SubQueries. Remember to separate parameters by a
comma. The whole expression should read:
coalesce(SubQuery1.Customer_CustID, SubQuery2.Customer1_CustID)
10. Click New and create another calculated field to display values in the Country column. Make sure the
expression looks as follows:
coalesce(SubQuery1.Customer_Country, SubQuery2.Customer1_Country)
12. Now to the list of Display columns, add both calculated fields from inner SubQueries that aggregate total
values of orders and quotes.
10.2.700 343
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
13. One additional step is required when building this query. Create SubQuery criteria to provide equality of
Customer ID and Country fields. Also, you need build separate conditions to make sure SQL null value in
one field is not equal to null value in another field. These null values will appear in total lines produced by
the ROLLUP aggregation.
The criteria for the TopLevel Subquery should look as follows:
344 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. Notice the total values are summarized by each customer (aggregate rows), sub-totals rows for each country
with the grand total value displaying at the bottom.
3. Now let's test how query results change using the GROUPPING SETS operator. In both inner SubQueries,
modify the Group By expression as follows:
GROUPING SETS( Customer.Country,Customer.CustID )
10.2.700 345
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. Lastly, let's test how BAQ results change when the CUBE function is used to construct the GROUP BY clause.
Modify both expressions as follows:
CUBE( Customer.Country,Customer.CustID )
346 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. Notice the CUBE operator outputs a grouping for all permutations of expressions in the composite element
list.
10.2.700 347
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
You can use the UNION, EXCEPT, and INTERSECT operators to combine more than one SELECT statement to
form a single result set. The UNION operator returns all rows. The INTERSECT operator returns all rows that are
in both the result sets. The EXCEPT operator returns the rows that are only in the first result set but not in the
second one.
In the previous case study - Combine Results Sets - you learned how to use the UNION operator to combine
results of multiple SubQueries into a single result set. In this case study, learn how to intersect the results of two
SubQueries and use the EXCEPT operator to retrieve the query result set where data exists in the first SubQuery
and not in the second one.
1. Click New.
348 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. Create the following criteria. To set the Filter Value, use the specified constant option.
10.2.700 349
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
12. Move the following columns from the Available Columns area to the Display Column(s) area:
• Customer_CustID
• Customer_Country
• OrderHed_OrderNum
14. You are ready to test the query. Navigate to the Analyze sheet.
350 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
16. In this example, the BAQ returns order records from customers based in the USA or Canada.
10.2.700 351
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
352 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
9. Create the following criteria. To set the Filter Value, use the specified constant option.
10.2.700 353
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. Move the following columns from the Available Columns area to the Display Column(s) area:
• Customer1_CustID
• Customer1_Country
• OrderHed1_OrderNum
13. You are ready to test the query. Navigate to the Analyze sheet.
354 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
15. In this example, the BAQ returns order records from customers based in Canada.
10.2.700 355
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. Click Save.
4. Now test how the BAQ results change. Navigate to the Analyze sheet.
356 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. Click Test.
6. In this example, the BAQ returns 285 order records from customers based in USA.
10.2.700 357
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
A Common Table Expression (CTE) can be thought of as a temporary result set defined within the execution
scope of a single SELECT (or may serve as a SubQuery, instead of SELECT). Returning hierarchical data is a common
use of recursive queries.
1. Click New.
358 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 359
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
8. Place the Erp.PartMtl table onto the canvas in the center pane.
9. Click Save.
360 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. You now define which BAQ fields you want to filter by the parameter you specified. Navigate to the Query
Builder > Phrase Build > SubQuery Criteria sheet.
10.2.700 361
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. From the Filter Value list, select the specified parameter option.
12. Verify the PartNum parameter you created is highlighted and click Select.
Select Columns
362 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. Move the following columns from the Available Columns area to the Display Column(s) area:
• PartMtl_Company
• PartMtl_PartNum
• PartMtl_RevisionNum
• PartMtl_MtlSeq
• PartMtl_MtlPartNum
• PartMtl_QtyPer
• PartMtl_RelatedOperation
• PartMtl_PullAsAsm
• PartMtl_ViewAsAsm
• PartMtl_PlanAsAsm
Now you are ready to build the BOM Level hierarchy calculated field and Indentation calculated field.
4. Click New.
10.2.700 363
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
9. Click New.
364 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. In the Field Name field, enter Ind1 and press Tab.
12. In the Editor pane, enter the following code that calculates the indentation level of subassembly parts:
cast ( substring('........',1 ,(Hierarchy + 1) ) + PartMtl.MtlPartNum
as nvarchar(25))
10.2.700 365
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
366 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
For SubQuery2, you use the PartMtl table again, but this time you join it with CTE SubQuery1.
7. To switch tables and subqueries, use the buttons above the list of tables.
8. Create a manual connection between the two tables using the Add Connection (chain links) button.
9. Use the following fields to create an inner join between the tables:
Select Columns
2. Move the following columns from the Available Columns area to the Display Column(s) area:
• PartMtl1_Company
• PartMtl1_PartNum
• PartMtl1_RevisionNum
10.2.700 367
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
• PartMtl1_MtlSeq
• PartMtl1_MtlPartNum
• PartMtl1_QtyPer
• PartMtl1_RelatedOperation
• PartMtl1_PullAsAsm
• PartMtl1_ViewAsAsm
• PartMtl1_PlanAsAsm
Now you are ready to build the calculated field to increment the BOM Level hierarchy.
4. Click New.
9. Click New to create another calculated field. The Indentation you create references the UnionAll SubQuery
Aliases. Otherwise, it is similar to the one created within the CTE SubQuery.
368 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. In the Field Name field, enter Ind2 and press Tab.
12. In the Editor pane, enter the following code that calculates the indentation level of subassembly parts.
cast ( substring('........',1 ,(Hierarchy2 + 1) ) + PartMtl1.MtlPartNum
as nvarchar(25))
10.2.700 369
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
In the TopLevel SubQuery3, you display data from the CTE SubQuery1.
370 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. From the list of SubQueries, select SubQuery1 and place it on the canvas. Accept the new Alias the BAQ
creates.
8. Move all the columns from the SubQuery11 to the Display Column(s) area
9. Click Save.
You are now ready to test the query.
10.2.700 371
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
4. Click OK.
372 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
6. To display the hierarchy, group the BAQ results by the BOM Level and Indentation (Ind1) columns.
10.2.700 373
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Now the BAQ results are broken down by levels. The BOM Level 0 displays the parent part - in this case
DCD-200-ML with its subassemblies showing on their respective levels within the Bill of Material.
BAQ Combo
Use this customization tool to create a drop-down list which displays information from a selected business activity
query (BAQ).
After you customize the form and draw the BAQCombo, indicate the specific BAQ and the ValueMember column
which holds the data. You then define the DisplayMember column the customization uses to display the data
during run time on the form.
Note you can create updatable BAQs which allow users to enter data directly into a business object. On the
updatable BAQ, you can define one of the updatable columns to use a BAQCombo. Users can then enter data
through this drop-down list.
374 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
4. Select the Shared check box to indicate other users within the current company can use this query.
10.2.700 375
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
9. In the Calculated Field Editor, click New. In this example, you create a query that displays the list of customers
and part numbers from the OrderDtl table.
376 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10. In the Field Name field, enter the name of the field, for which you create the calculation. In this example,
enter CustomerPart.
11. From the Data Type drop-down list, select the data type generated by this calculation. In this example,
select nvarchar.
13. For the Label, that displays above this calculated field's column header on the BAQ grid, enter Cust Part.
10.2.700 377
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
17. Click the Test button and verify the BAQ results.
1. Access the Sales Order Entry with the Developer Mode feature turned on.
378 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. In the Customization Tools Dialog, from the Tools menu, select Toolbox.
10.2.700 379
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. Draw the combo inside the form and enter the following information.
7. Set the DisplayMember property to the column you want to display in the drop-down. In this example,
enter Calculated_CustomerPart.
8. Set the ValueMember property to the column you want to be stored in the Epibinding field you select. In
this example, you again select Calculated_CustomerPart.
10. Set the AutoWidthOption property to ControlWidth. This will set the drop-down be the size of the control
- in this case, Calculated_CustomerPart.
11. Set the Epibinding property to the column you want to store data value defined in the ValueMember
property.
In this example, you set a custom field OrderHed.ShortChar01 which was previously added to the data
model.
For more information on how to create user defined fields using Extended User Defined Table Maintenance,
see the Add User Defined Fields topics find in the Customization User Guide.
12. You can also add the EpiLabel to the form to describe the combo you added.
380 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
14. Re-open Sales Order Entry using the customization you created.
10.2.700 381
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
15. The BAQ combo now displays all BAQ results. You next configure the BAQ to filter the results based on the
customer selected on the Sales Order header.
For more information on how you can customize the Epicor ERP application, see the Customization User
Guide.
1. Navigate back to the Business Activity Query Designer with the CustomerParts query in focus.
382 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. On the Query Builder > Phrase Build sheet, select the Customer table on the canvas.
7. From the Filter Value drop-down list, select the specified constant option.
10.2.700 383
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
11. The BAQ is now complete. Save and exit the query.
384 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
1. Activate the Developer Mode and launch the customized Sales Order Entry form again.
3. As you navigate and change rows, the combo is re-filtered by the current customer.
10.2.700 385
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
Another way of using BAQ combos are parent/child user-defined tables, for example UD100 and UD100A.
For example, you can use the EpiRetrieverCombo to select the data from the parent table and bind that
data to a specific table column (Epibinding). You can then use a BAQ Combo and use the Epibinding
markup syntax to filter the query results using the value selected in the EpiRetrieverCombo. For more
information, review the User-Defined Tables topics in the Customization User Guide.
This topic discusses how to modify a legacy BAQ utilizing First or Last table modifiers to make it compatible with
E10 syntax.
In previous Epicor 9 version, you can use the following table modifiers to control which data is retrieved from
each table:
• Each – All the rows of data within this table are pulled into the query; these rows are not sorted.
• First – Only the first row of the linked table that matches the criteria is returned.
• Last – Only the last row of the linked table that matches the criteria is returned.
When importing or migrating a legacy BAQ having First/Last modifiers into Epicor ERP version 10, adjustments
in BAQ Designer are needed in order to get the same results.
Typically, the same query results can be accomplished by using:
• If First/Last table modifier was used on the parent (first) table in E9, then this behaviour can be accomplished
by sorting data (Asc, Desc) and using the TOP N clause in the Toplevel Subquery
386 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
• If First/Last table modifier was used on any subsequent (child table), then this behaviour can be accomplished
in two ways:
• If you want to retrieve one or more fields from a table, create a SubQuery with parent-child tables. Add
column sorting and use the TOP N clause to retrieve number of rows of your choice. You then add reference
fields into Subquery's display fields.
• If you want to retrieve a single field from a table, create a SubQuery with a child table. Add Group By
fields involved in relation between parent and child tables. You then add a Calculated field with Min/Max
function against a field to determine the First/Last record you want to retrieve. You then reference this
field in the SubQuery's display fields.
Example 1
The below legacy query returns the list of all customer along with their latest sales order numbers recorded in
the system. Notice the last table modifier placed on the OrderHed table retrieves the most recent order number.
As the left outer join is used to define relationship between tables, the BAQ also displays customers who have
not yet placed an order.
10.2.700 387
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
This method shows how to retrieve a single record using the Calculated Field. To get the same results in Epicor
ERP 10:
1. Create a TopLevel SubQuery and place the ErpCustomer table on the canvas.
388 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
2. Create another SubQuery of InnerSubQuery type and place the OrderHed table (child table) on the canvas.
10.2.700 389
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. Add Group By fields you will use in relation between parent and child tables.
390 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
5. Switch to the TopLevel SubQuery and place the SubQuery2 on the canvas.
10.2.700 391
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
392 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
Example 2
The below legacy query returns the most recent part revision for the selected part. Notice the last table modifier
placed on the PartRev table retrieves the latest revision.
10.2.700 393
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
394 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
In this example, learn how to get the same BAQ results in Epicor ERP 10 by sorting data and using the SQL TOP
N clause:
1. In the TopLevel SubQuery, place the Erp.Part table on the canvas and apply the table filter.
10.2.700 395
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. Create another SubQuery of InnerSubQuery type. Place the Erp.Part and Erp.PartRev tables on the canvas.
396 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
3. For the Erp.Part table, create identical Table Criteria as in the TopLevel SubQuery.
4. Select Inner SubQuery display columns you will later use to create relationships and display data in the
TopLevel SubQuery.
5. Sort Inner SubQuery data by the RevisionNum column in the descending order. This puts the latest revision
at the top of query results.
10.2.700 397
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. Now define the SELECT TOP clause and specify you want to return a single row.
398 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
7. Switch to the TopLevel SubQuery and place the SubQuery2 on the canvas.
10.2.700 399
Chapter 1 | Business Activity Queries Epicor ICE 3.2 Tools User Guide
400 10.2.700
Epicor ICE 3.2 Tools User Guide Business Activity Queries | Chapter 1
10.2.700 401
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
Use the External Query functionality to create a connection to external (non-Epicor) data sources. This feature is based
on accessing external data via ODBC connections and provides the mechanism for retrieving, updating and displaying
information from an external database using the SQL language. Working with external data source looks similar to
ordinal query design and execution. The data you retrieve using the external query can be used in additional dashboard
renderings, like dashboard applications, mobile framework, Epicor Sharepoint Publisher and so on.
To use the functionality, you need an ODBC connection to an external server configured on the machine where the
application server is hosted. This connection must also be specified when you create the query. Through the External
BAQ Designer, you can browse and select tables from an external data source in the same way as when data is pulled
from the Epicor database.
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 machine and
compose a connection string to access the external database management system.
• Set up security restrictions to schema and data coming from an external datasource.
• Modify external datasource metadata specified in the source database as required.
• Enable the external datasource you create in the company you work with.
• 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.
This chapter describes how to set up and configure connection to an external datasource. The process of building a
query is nearly identical to ordinal BAQ design. For more information on how to construct a query, see the Business
Activity Queries chapter.
Use External Datasource Type Maintenance to set up security restrictions to schema and data from an external
datasource.
On the Data Filtering, you can set up restrictions to limit the data displayed by the query. You can create a
single criterion that pulls in the data you need. You can also create a combined criteria by linking your criterion
with And or Or statements.
On the Schema Filtering sheets, you can apply a filter on a schema level by selecting which tables and columns
you want to display in External Business Activity Query Designer.
402 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
1. Click New.
3. The Application Type field is used to control any specific logic or flow that is related to specific applications
associated with the datasources.
• Generic - Use this default option to create a datasource type for any type of target databases. Using
this type, the whole communication between the application and external data source is performed using
the .ADO.Net datasource.
• Prophet21 - Use this option when you integrate the Epicor ICE framework with Prophet 21(P21)
application.
• Eclipse - Use this option when you integrate the Epicor ICE framework with Epicor Eclipse application.
• iScala - Use this option when you integrate the Epicor ICE framework with Epicor iScala application.
4. In the Description field, enter a brief text to describe the purpose of the datasource type.
5. The Owning Company displays the company inside which the current DataSource Type was created. You
cannot change this value; only users within the Owning Company can modify this record.
6. Click Save.
10.2.700 403
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
The first step to filter data coming from an external datasource is to create a new security group.
3. In the FilterGroupName field, enter a unique name for the security group.
Example Company_ID
The below steps discuss how to create a filter to limit the data the external datasource displays through BAQ.
To complete the data filtering:
1. On the Detail > Data Filtering sheet, in the lower pane, click the New Filter button.
A new row displays on the grid.
404 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
2. In the FilterName field, enter a name for the definition or accept the default value.
Example Filter1.
3. In the TableName field, enter a name of the table used in the criterion.
You can accept the default value of --any table --, which means that any table within the datasource should
be checked for some field. It is also possible to use wildcard characters to limit the list of tables used to filter
the data.
4. In the FieldName field, enter a name of the field the rule will valuate.
Example Company_id
5. In the DefaultConstant field, select a BAQ constant from the drop down list or manually enter the constant
value.
Example
• BAQ constants - CurrentCompany, CurrentUserID
• Manually entered constants - "Company1", "True"
10.2.700 405
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. When you need to apply a filter based on the values of more than one criterion, use the And/Or field to
define the criteria string clause.
7. If you want this criterion to evaluate a Not criterion value, select the Not check box.
8. If needed, use the Left Parenthesis and Right Parenthesis fields () to insert parenthesis to the clause.
9. If you want to change the sequence through which filters run, highlight a filter on the grid and click either
the Move Up or Move Down buttons.
The below steps discuss how to limit which tables display for selection when you design a new query using BAQ
Designer.
To apply a filter on the table level:
3. In the SchemaName field, enter a name of the database schema used in the criterion.
You can accept the default value of --any schema -- to display or hide tables for any schema within the
selected datasource. It is also possible to use wildcard characters to limit the list of schemas used in the filter.
406 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
4. In the TableName field, enter a value to limit which tables become available for selection creating a BAQ
using the datasource.
You can accept the default value of --any table --, to apply a filter on all tables within the selected database
schema. It is also possible to use wildcard characters to limit the list of tables used to filter the data.
5. When you need to apply a filter based on the values of more than one criterion, use the And/Or field to
define the criteria string clause.
6. If you want this criterion to evaluate a Not criterion value, select the Not check box.
7. If needed, use the Left Parenthesis and Right Parenthesis () fields to insert parenthesis to the clause.
8. If you want to change the sequence through which filters run, highlight a filter on the grid and click either
the Move Up or Move Down buttons.
10.2.700 407
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. In the SchemaName field, enter a name of the database schema used in the criterion.
You can accept the default value of --any schema -- to display or hide selected tables and columns for any
schema within the selected datasource. It is also possible to use wildcard characters to limit the list of schemas
used in the filter.
4. In the TableName field, enter a value to limit which tables and respective fields become available for
selection.
You can accept the default value of --any table --, to apply a filter on schema or column level only. To limit
tables and respective fields from displaying in BAQ Designer, you can use SQL Server wildcard characters,
such as % or _ (underscore).
5. In the FieldName field, enter a value to limit which columns become available for selection in BAQ Designer.
To limit certain fields from displaying in BAQ Designer, you can use SQL Server wildcard characters, such as
% or _ (underscore).
6. When you need to apply a filter based on the values of more than one criterion, use the And/Or field to
define the criteria string clause.
7. If you want this criterion to evaluate a Not criterion value, select the Not check box.
8. If needed, use the Left Parenthesis and Right Parenthesis () fields to insert parenthesis to the clause.
9. If you want to change the sequence through which filters run, highlight a filter on the grid and click either
the Move Up or Move Down buttons.
Use External Datasource Maintenance to create a connection to an external database management system.
When you create a new datasource, first specify a datasource name, concise description and select an available
DataSource Type. Datasource types are created in External DataSource Type Maintenance. You can use
datasource type to apply security restrictions to schema and data.
To connect to an external datasource, you must compose a connection string. First, select one of the ADO.Net
providers available on the server. ADO.NET is the .NET technology; an object-oriented set of libraries for interacting
with data sources. There are several data providers you can use to communicate with different data sources. To
create a data source using the iScala datasource type, selecting of ADO.Net provider is disabled, you only create
a connection on the Distribution tab.
408 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
<system.data>
<DbProviderFactories>
<add name="SqlClient Data Provider"
invariant="System.Data.SqlClient"
description=".Net Framework Data Provider for SqlServer"
type="System.Data.SqlClient.SqlClientFactory, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>
</DbProviderFactories>
</system.data>
The following table outlines some of the data providers you can use to query an external database:
Description
.NET Framework data provider
.NET Framework Data Provider for SQL Provides data access for Microsoft SQL Server version 7.0 or later.
Server Uses the System.Data.SqlClient namespace.
.NET Framework Data Provider for OLE DB For data sources exposed by using OLE DB (Object Linking and
Embedding Database). It uses the System.Data.OleDb namespace.
.NET Framework Data Provider for ODBC For data sources exposed by using ODBC (Open Database
Connectivity). It uses the System.Data.Odbc namespace.
.NET Framework Data Provider for Oracle The .NET Framework Data Provider for Oracle supports Oracle client
software version 8.1.7 and later, and uses the
System.Data.OracleClient namespace.
1. Click New.
10.2.700 409
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. In the Datasource field, enter a unique identifier that best describes the external datasource.
4. In the Datasource Type field, select a type you wish to use in your external datasource.
Datasource types are created in External DataSource Type Maintenance. You can use datasource type to
describe security restrictions applied to schema and data from an external datasource.
5. The Owning Company field displays the company in which the current external datasource was created.
This value displays in a read-only format.
6. In the ADO. Net provider field, select a provider available on the server.
A provider you select is used for connecting to a database, executing commands, and retrieving results. In
this example, SqlClient Data Provider is selected.
7. For OleDB, ODBC and SQL providers, build the connection string by entering adapter properties on the
Key properties tab.
For the remaining ADO. Net providers, build the connection string using the DB Connection and Advanced
Properties tabs.
410 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
8. In this example, first enter a Data Source; specify a server name and instance name.
9. Then specify an Initial catalog (DB name) you want to connect to.
10. If you want to connect to an external datasource using the Windows security, set the Integrated Security
property to True. This means the credentials of the account running the Epicor Application Pool are used
for authentication. If the account does not have required permissions to access the SQL Server database,
use the SQL Server credentials to log in.
11. If you want to connect to the database using server credentials, enter a valid User ID and Password.
12. Note that for security purposes, the information about the current password is not exposed to any user.
13. Apart from the default connection parameters offered by the selected .NET provider, the following Epicor
specific keys are available for use when building a connection string.
14. When setting up connection parameters, on the Advanced Properties sheet you can specify detailed
properties for Windows supported .NET providers, such as ODBC, OLE DB and SQL client. The list of driver
properties vary based on selected ADP. NET provider. For more information on specific driver properties,
refer to the Microsoft® Developer Network at http://msdn.microsoft.com/en-US/.
10.2.700 411
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
15. The Connection string pane contains initialization information that is passed as a parameter from a data
provider to a data source. The syntax depends on the data provider, and the connection string is parsed
during the attempt to open a connection.
412 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
16. Use the Test Connection button to verify the connection to an external datasource is successful.
10.2.700 413
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. The External System pane fields vary based on the selected Datasource Type.
3. In the iScala Server field, enter the full domain name of the iScala server (or the name for which https
binding of IIS hosting iScala WCF services is configured).
For Prophet 21 and Eclipse integration this field displays the Token server URL field. Enter the URL of the
server that validates calls from ICE framework against external application.
4. For Client ID, enter the user name to be used by BAQ engine to authenticate in external system.
5. In the Client secret field, enter the password configured in external system for the above user.
6. After you enter the Username and account password, you can select how to impersonate the user:
• never
• always
• always; fail if not associated
414 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
7. You can set the maximum number of rows the external query is allowed to return. To do so, enter a value
in the Query Maximum Row Count field.
8. The Query Execution TimeOut (Sec) value specifies the longest time (in seconds) in which a query can
run, when executed by the datasource in focus. Specifying 0 for this option indicates all queries are allowed
to run indefinitely.
Export Datasources
Use the Export Datasources functionality to make your external datasources available to users at another
location.
When you export a datasource as a .baqds file, users outside your network can then import this definition onto
their client machines and establish connection to an external datasource. You can also use this functionality to
archive your datasource definition.
To export datasources:
10.2.700 415
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
3. By default, all selected datasources, related datasource types and company settings are selected for export.
4. You can customize the exports list using the check boxes that display next each item.
6. Enter a File name and select a location of the exported *.baqds file.
7. Click Export.
8. View the Export process messages pane and verify the process is complete.
9. Click Close.
The exported datasource(s) definition is now available to other users.
416 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
Import Datasources
Use the Import Datasources functionality to import previously exported datasources and datasource types into
your environment.
To import external datasources:
4. You can customize the list of imported items by selecting a check box next to each datasource, datasource
type and company settings you want to import.
5. Click Import.
10.2.700 417
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. View the Import process messages pane and verify the process is complete.
7. Click Close.
Verify the connection to an external is successful. If necessary, click Configure button to modify Database
Connection Parameters.
When you create an ODBC connection, it is important to understand which kind of Data Source Name (DSN) you
should use on the system. On an x64 system, you can create an ODBC connection (DSN) on the 32-bit side of
the system as well as on the 64-bit side.
The Epicor ICE3 framework used by Epicor ERP and BAQ takes bitness into account, when a user works with
BAQ External Data Sources and executes external queries. BAQ distinguishes 32bit and 64bit ODBC datasources
to provide compatibility between bitness of IIS process and of underlying ODBC driver dll file. Hence, if the
application utilizing the Epicor ICE 3 framework is running in the 64bit mode, it doesn't see 32bit DSNs, and vise
versa.
1. To configure 32bit ODBC datasources, you can call ODBC Data Source Administrator tool using this command
line:
%windir%\SysWOW64\odbcad32.exe
2. In order for BAQ to see and consume 32 bit ODBC datasources, in Internet Information Services (IIS) Manager,
select ERP10/ICE3 application pool.
418 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
5. To configure 64bit ODBC datasources, call ODBC Data Source Administrator tool using this command line:
%windir%\system32\odbcad32.exe
10.2.700 419
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
6. In ERP10/ICE3 application pool, for Enable 32-Bit Applications property, select False.
Microsoft does not support the side-by-side installation of 32- and 64-bit Microsoft Office or their
dependent components. If you need to have both MS Office ODBC driver variants on the same machine,
install the needed driver using the "/passive" command line parameter.
Use the External Datasource Metadata Maintenance to modify column properties of data coming from an
external datasource.
In External Business Activity Designer, column properties such as format, label or description display according
to the underlying metadata specified in the source database. When there is no metadata specified for a table,
External Business Activity Designer automatically determines all required column properties.
In External Datasource Metadata Maintenance, you can manually change properties of columns you want to
include in your Business Activity Query.
420 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
First, select a Datasource Type for which you want to modify metadata and select one of the datasources
attached to the Datasource Type. The datasource you select provides a list tables you can select to modify
metadata.
Example
You want to create an updatable Business Activity Query (BAQ)
that displays the list of customers. Because you typically contact
your customers via email, you want to make sure the email
address field for each customer is filled. In External Datasource
Metadata Maintenance, you select a Datasource Type and a
Sample Datasource that provides the data for the query. You
will then search for a customer table that holds the information
you need. On the Field Detail sheet, highlight the email address
field and select the Required check box. When you create an
updatable BAQ and use it on a dashboard, users will not be
able to change the existing customer information or create a
new customer record unless they enter a value in the email
address field.
10.2.700 421
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. The Owning Company inside which the selected DataSource Type was created, along with the Type
description display for your information only.
3. In the Sample Datasource field, select an external datasource associated with the selected datasource type,
for which you want to create metadata.
6. Click Tables.
7. In the External Tables window, search for a table or multiple tables for which you want to modify column
properties.
422 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
You can narrow down the list of tables you want to retrieve by entering a value in the Table Name
Starts with field and selecting a database schema.
10. The table you select display as a node in the Tree View on the left side of the form.
10.2.700 423
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
2. The grid displays the Customer table you retrieved form an external datasource.
3. You can enter a value in the Description field to create custom table description.
In this example, enter List of Customers.
424 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
You cannot modify the rest of the fields; they display for your information only.
1. In the Tree View, expand the table and select a field you want to modify.
3. The Fields > Field Detail sheet is automatically selected, presenting the existing properties of the selected
field.
4. In the Description field, you can explain the field's purpose and provide other helpful information.
In this example, enter Customer Email Address.
5. The Field Table defines the column's title when used on a query or a dashboard.
In this example, enter Email.
6. The Format displays the layout for the characters within the field. This value can be displayed in either
schema or alphanumeric format. You can change this value if necessary.
7. By selecting the Required check box you indicate the field cannot be empty. When users attempt to save
a new or existing record within the query and this field is blank, they will not able to save the record until
they enter a value in this field.
8. If you want to prevent users from changing the data in this field, select the Read Only check box.
10.2.700 425
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
9. To view the list of all fields of the selected external table, navigate to the Fields > Field List sheet.
10. View the metadata information you entered for the EmailAddress field.
You can use this sheet to modify properties of multiple fields at once, for example, to make certain fields
mandatory, change their label and so on.
Before you can use the created datasource to build an External Business Activity Query, you must authorize it for
the current company.
Use the BAQ External Datasources sheet within Company Maintenance to enable external datasources for the
company. On this sheet, you can also configure which of the available filters (from the Datasource Type associated
with the each of the chosen External Datasources) to use, or skip when External BAQs are executed in this
company. Using this approach, different companies can user the same External Datasource/Datasource Type but
bypass or execute the filters differently.
Navigate to Company Maintenance.
Menu Path: System Setup > Company/Site Maintenance > Company Maintenance
426 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
2. In the Datasources grid, based on Company Visibility and Owning Company, all datasources on the server,
or within the Tenancy (SaaS installations) appear as available for enabling.
3. Select the Enabled check box for each datasource you want to make available within the current company.
4. The Company field displays the Owning Company of each datasource. Note each record can only be
modified from its Owning Company.
5. If you want to skip security checking for the selected datasource, in the Datasources grid, select the Skip
Filter check box. Once selected, Filter Groups and Filter Definitions specified for the datasource are ignored.
6. If you wish to skip security checking for a specific group defined for the selected datasource, in the Filter
Groups grid, select the Skip Filter check box.
Example
In the External Datasource Type Maintenance, you
can create multiple filter groups. The selected external
datasource retrieves the required data based on
datasource type settings. For example, you can filter the
10.2.700 427
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
7. If the selected filter group uses a Default constant to filter the data, you can use the Filter Definitions grid
to override this constant.
8. The current value of the selected constant displays in the Constant Value field.
In this example, the current company value is EPIC06.
9. If you want to override this constant by applying a custom value, clear the Use Default check box and enter
a custom constant in the Value field, for example, EPIC03.
External Business Activity Query provides the mechanism for retrieving, updating and displaying information from
an external database using the SQL language. It serves as an interface you use to create custom SQL text. The
query text is then sent to the database server using the selected .NET provider, where it is executed. The information
you retrieve serves as a data source for reports, dashboards or searches.
Navigate to External Business Activity Query.
Menu Path: System Management > External Business Activity Query > External Business Activity Query
1. Click New.
428 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
4. Notice the Author field displays the name of the user who created the current business activity query. Other
users cannot modify the current query. If you need to assign author rights to another user, use the Actions
> Change Author option.
5. The Owning Company displays the company inside which the current external BAQ was created. You
cannot change this value; only users within the Owning Company can modify this BAQ.
If the All Companies check box is selected, then companies within the same organization as the Owning
Company can view and use the query. If the System BAQ check box is selected, the Owning Company field
is blank. This indicates the current BAQ is available to all companies within the current organization.
6. If you want to make this query is available to all users, select the Shared check box.
7. The All Companies check box controls whether the current BAQ Definition is visible to all companies on
the same database server. When the Epicor application uses multiple companies contained within a single
database, the BAQ usage and visibility is applied regardless of multi-company direct configuration. For
companies hosted on different databases, this check box initiates the Service Bus processing, when it is
configured to synchronize BAQs to external companies.
If the custom BAQ is created from a Company that is running under a multi-tenant license, the definition
becomes visible to all companies within the same Tenancy as the Owning Company.
The options/values for tenant and multi-tenant features are only for Epicor hosted environments. Typically
you can ignore these options. Internal Epicor administrators who need more information should refer to
the Epicor SaaS Installation Guide.
10.2.700 429
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
To see in which companies (outside the current company), references to the BAQ were created, use the
Where Used tabs.
8. The System BAQ check box indicates whether the current BAQ is installed with the Epicor ERP application.
9. If you want to update the external database using this query, select the Updatable check box.
10. Cross-Company functionality controls the ability to bring back results across multiple companies.
You can only use this option with ordinal BAQs, this
feature is not supported in External BAQs.
11. In the External Datasource name field, select an external datasource available for the current company.
12. Click Test Connection to verify your connection to an external database is established.
14. You continue design the query in the same way as in Business Activity Query Designer.
The External BAQ Designer UI is almost identical as Business Activity Query Designer that is designed to work
with MS SQL Server 2008 and higher. All criteria filters, function lists in calculated fields, expressions,
supported SubQueries and SubQuery types are not modified in External BAQ UI.
A user designing an external query should only use those External BAQ Designer features which are supported
by the foreign Database Management System it uses.
Example
430 10.2.700
Epicor ICE 3.2 Tools User Guide External Business Activity Queries | Chapter 2
For more information on how to construct a business activity query, see the Business Activity Queries
chapter.
This topic provides general guidance for using an External Updatable Business Activity query to update an external
database.
When you pull external data into the Epicor ERP, you may as well want to be able to update this data in the
application and submit the changes back to the external datasource.
The implementation involves several processes that are described in more detail in the respective topics of this
guide and later in this topic. You first need to define your external datasource in the application and connect to
it - please refer to the External Datasource Maintenance on page 408 topic for details on this process. You then
need to create an External BAQ against your external database and make that BAQ updatable - the Design
External Business Activity Query on page 428. Finally, you need to add your custom update code specific to the
type of the external datasource you interact with.
3. Define the general properties: Query ID, Description, and External Datasource; Select the Updatable
check box.
10.2.700 431
Chapter 2 | External Business Activity Queries Epicor ICE 3.2 Tools User Guide
5. Select external database table(s) that contain data you need to pull and add them to the canvas.
6. On the Display Fields > Column Select, choose the columns from the previously specified tables that you
wish to display in the results grid.
7. On the Update > General Properties sheet, define the Updatable Query Settings per your needs.
If want to be able to update several records at once, make sure you select the Allow Multiple Row Update
option.
8. In the Updatable Columns grid, mark the field(s) you need to update as Updatable.
10. In the Processing method section, select the Advanced BPM Update only and click the BPM Directives
Configuration button.
The Updatatble BAQ Method Directives window pops up.
11. With the Update method selected, in the Main Menu, go to New > New Base Processing.
The Base Processing > Detail sheet opens for editing.
14. Enable and save the directive; close the Updatable BAQ Method Directives window.
If you need help setting up the integration with a specific external datasource, please contact the Epicor's
Professional Services team for assistance.
432 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
Use the BAQ Report Designer to turn a Business Activity Query (BAQ) into a SQL Server Reporting Services (SSRS) report.
You create a personalized BAQ through the Business Activity Query Designer. You then use the BAQ Report Designer
to select the BAQ as the base for a report, and to define the option fields, filters, and sort by options that appear on
the report interface. The reports you create through this tool are flat reports, which means they only pull data from
the table(s) defined on the selected BAQ. If you need to pull data from multiple queries (and so multiple tables), use a
Dashboard report to expand the amount of data to include. Dashboard reports are discussed in the Dashboards chapter.
To design and format the report, you use either Microsoft SQL Server Report Builder or Crystal Reports (provided for
backward compatibility with older reports). Once you complete the report layout, you can add it to the menu for users
to access. Then launch Report Style Maintenance to create a report style or styles for it. The style determines which
companies can access the BAQ report and other key options. You can also design a routing rule for each BAQ report.
Routing rules help you streamline reporting for specific business needs. They can be simple rules that define an alternate
report style users run when they need to print a report using a unique format, or complex rules that divide, or break,
the report run into multiple dataset partitions which they can link to separate rendering workflows for generating,
printing, previewing, and sending the report output.
A BAQ report is based on a selected existing BAQ and includes four standard datasets.
Before you create a report, you must first define the BAQ you are going to use. You can use an available BAQ
or create a new BAQ in the Business Activity Query Designer. The BAQ you use must contain the Company column
that is necessary to join the standard tables in the datasets (using the Company ID), and, most importantly, the
BAQReportParameter table. Once you identify the BAQ for your report, you use the BAQ Report Designer to
create a new BAQ report.
Each BAQ report contains four tables that display as the report's datasets in the Report Builder:
• Company – This table defines your Company ID and Company Name values, ensuring the BAQ is synchronized
with your company's data.
• RptLabels – The Epicor application uses this table for the standard text labels that display on the reports. This
table contains all the language versions of the current report. These report labels generate the field labels, so
each field on the report can display in a different language by matching the Label Name for each item.
• BAQReportParameter – The information written to this table originates from the parameter information
entered on the report user interface (UI). This information is used for two purposes: to display the parameters
on the report, and, when designing the report, to control sorting, summary, grouping, and so on.
• BAQReportResult table – This table contains the specific data pulled from the database that matches the
query parameters.
10.2.700 433
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
There are several standard BAQ reports, delivered with the application, that were created using the BAQ Report
Designer program.
Use the following steps to review the form (application interface) of the standard BAQ report Rebate Contract
Transactions. Being familiar with the BAQ report interface will help you when creating a new BAQ report later
in this chapter.
2. On the Selection sheet, the Report Options section displays fields for entering report parameters. In this
example, options include Start Invoice Date, End Invoice Date, Start Transaction Date, and End
Transaction Date. These options were defined when the BAQ report was created.
3. The Filter Summary section displays four filters - Part, Product Group, Customer, and Rebate. The
available filters also were defined when the BAQ reports was created.
434 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
5. On the Filter sheet, click the Part button to search for and select a part or group of parts.
10.2.700 435
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
8. The Filter Summary section displays Some Selected in the text box next to the filtered field.
9. Use the Sort By field to choose how you want the information in the report sorted when it prints. In this
example, the report is sorted by Customer and then by Invoice Date. The available sorting criteria also were
defined when the BAQ reports was created.
10. By default, all reports contain the remaining fields for Report Style, Schedule, Archive Period, and User
Description.
11. Click the Print Preview button on the standard toolbar to display the report on your screen. PDF is the
default display for the Standard - SSRS report style.
12. Use the Generate Only button to generate each report as an electronic file to view and print later. The
generated report is available to preview and print for a period of time you define on the report window.
13. Click the Generate for Design button on the standard toolbar to modify BAQ reports. The generated
report appears on the System Monitor. From here you launch the Design and Test SSRS program that enables
436 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
you to download the SSRS Report Data Definition to a local working copy and interact with SSRS Report
Builder.
3. In the BAQ Report Options dialog box, you can see the Crystal Report Options that are retained for
compatibility with previous application releases.
4. In the Crystal Report Executable field, browse for or enter the path to the Crystal Reports .exe file.
The system will launch Crystal Reports when you choose to design your report using this program.
10.2.700 437
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
5. Use the Local Reports Directory field to define the directory you use to save your BAQ Report (.rpt) files.
When you create reports within the BAQ Report Designer, they automatically save to this location. Later
when you launch Crystal Reports, you can navigate to this directory path and open the .rpt file. You may
then modify the layout of this report.
6. If you select the Copy Report Locally option, the BAQ Report Designer creates a duplicate copy of each
BAQ report. This file is then a backup copy for the report.
7. Click Apply if any changes were made, then close this dialog box.
This example demonstrates how to create a BAQ report based on an existing BAQ, design the report layout in
the SSRS Report Builder, save the report (.rdl) on the SSRS Report Server, and add the report to the application
menu. Advanced users can design both BAQs and SSRS reports that address complex data reporting requirements.
438 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
3. Use the Company drop-down list to define the company for which this BAQ report is created. If you are in
an Epicor ERP environment, you can create BAQ reports for either all companies or the current company. If
you are in an Express or Saas Standard environment, this drop-down list is read-only and displays the current
company. In this example, select the All option.
4. Working on the Detail sheet, in the Report ID field, enter an ID for the new report. In this example, enter
CustOV.
The Report ID cannot contain any spaces. Once you enter and save a Report ID, you cannot change this
identifier. You can, however, make a copy of the report to create a new identifier.
If you know the name of the BAQ, you can enter it directly in the BAQ ID field.
10.2.700 439
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
5. Enter a Description for the report. In this example, enter BAQ Report - Customer List.
6. Click the BAQ ID button to search for and select the BAQ to use in this report. In this example, choose
zES_Customers.
7. The text entered in the Form Title field displays as the title of the report. In this example, enter Customers
Overview.
8. For SSRS Report, note that CustOV.rdl has been added automatically based on the value in Report ID.
9. Click Save.
10. A new combination of report data definition and report style has been created automatically for your new
BAQ Report. To review, navigate to Report Maintenance. You can leave the BAQ Report Designer open.
Menu Path: System Management > Reporting > Report Style
440 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
10.2.700 441
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
Use the Option Fields sheet to set up record selection criteria users can enter as parameters when running the
report. In this example, add fields for the state where a customer is located and for the customer name.
2. The Option Fields sheet automatically displays with a line for the new option.
442 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
3. Option Field indicates the BAQ Report column on which the option is based. All the columns contained
within the selected BAQ appear on this list, as well as report parameter columns such as
ReportParam_Character01, ReportParam_Number02, ReportParam_Date05, and so on. For this example,
select Customer_State.
6. For Data Type, leave the default nvarchar. This value is based on the data definition of the field selected
in the option field.
7. Click the New button to add one more line for another option.
8. In the line for the new option, for Option Field, select Customer_Name.
12. In the Order column, enter 1 for the Customer_Name option and enter 2 for the Customer_State option.
This sets the order in which the options fields display on the report form.
10.2.700 443
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
In BAQ Report Designer, use the Test Report Form action to perform an initial test of the new report.
This verifies the report form and print preview functionality for the new report and enables you to obtain, from
the System Monitor, the report's TableGuid identifier that will be needed for testing the report while you are
working on the report design in Report Builder.
1. With the new report CustOV displayed on the BAQ Report Designer Details sheet, choose Actions > Test
Report Form to display the report's form.
2. On the report form, verify that the option fields that have been added to the form are present.
444 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
4. The report displays with a header layout based on the template for new SSRS reports. Note that the BAQ
that is the basis for the report is shown as is the report title that was entered when creating the report.
In the application, PDF is the default print preview format for SSRS reports, Later in the chapter, SSRS Report
Builder will be used to add data fields to this starting point.
5. Close the report and report form, launch the application's System Monitor. Navigate to the Reports sheet
and locate the line for your report.
6. The TableGuid identifier is in the FileName column. You may need to scroll to the far right end of the grid
to locate the column.
The value will be similar to this example. Record , for later use, the actual value you are seeing. You will not
need the REPORT DATABASE: portion.
7. Close or minimize the System Monitor and remain in the BAQ Report Designer.
10.2.700 445
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
Use SSRS Report Builder to design the new report's data layout.
1. With the new report CustOV displayed on the BAQ Report Designer Details sheet, choose Actions >
Download SSRS Report.
446 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
2. Open the report with Report Builder to edit and design its layout. For a new report, the report header layout
stored in the template file BAQReport.rdl is applied automatically.
3. In Report Builder, select the Insert tab and then select Table > Table Wizard to run the New Table or
Matrix wizard.
4. On the wizard's Choose a dataset screen, choose the dataset that will be the source of the fields that you
add to the report design. For this example, choose BAQReportResult, which is a one of the standard
datasets associated with a BAQ and BAQ report. Click Next.
10.2.700 447
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
5. Starting in the Available Fields list on the Arrange Fields screen, move fields into the report layout. For
this example, move the following fields and then click Next.
• Move Customer_Name, SalesRep_Name, Customer_City, Customer_State, and Customer_Country
to Row Groups.
• Move Customer_CustID and Customer CreditHold to Values.
448 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
6. On the Choose the Layout screen, enable or disable options for showing totals and grouped data. For this
example, clear all options and click Next.
7. On the Choose a Style screen, choose a style that controls fonts and color. For this example, accept the
default and click Finish to close the wizard.
10.2.700 449
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
8. The report layout now includes the selected data fields and choices for layout and style.
10. To test your design in Report Builder, verify that you are on the Home tab and click Run.
450 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
11. At the top of the report page, enter the TableGuid identifier obtained from the application System Monitor
earlier in the chapter and click View Report.
The report runs in HTML format, as it would if it was run from SQL Server Report Manager.
13. In Report Builder, you can continue to make adjustments to the report design. As you work, be sure to save
and retest the report as described in steps 9-12. When you are satisfied with the report, click the Report
Builder button and choose Exit Report Builder.
10.2.700 451
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
14. In BAQ Report Designer, click Actions > Upload SSRS Report.
When you specify the path to the report file you are
uploading, make sure you don't drill down beyond the
parent folder of the reports folder that was created
automatically during download. For example, if you report
has been downloaded to
User/Documents/reports/CustomReports/, the path
for upload will look like this: User/Documents/.
15. In BAQ Report Designer, test the report to verify it in the application. Click Actions > Test Report Form
to open the report's form.
452 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
16. Click Print Preview to display the report with your design work. Leave the Report Options fields blank
for this test.
10.2.700 453
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
18. Close the report and test the report options added to the form earlier in the chapter. In the State/Prov
field, enter MN and click Print Preview.
19. The report displays with the list limited to customers located in Minnesota. Close the report and report form
when done, but remain in the application.
454 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
Add the BAQ report to the menu system in the Epicor ERP application.
For this example, the BAQ report is added to the application menu structure under Sales Management. You can
use locations and values that match the report you are working with.
10.2.700 455
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
2. On the Menu Maintenance tree, navigate to: Main Menu > Sales Management > Order Management
> Reports. Verify Reports is highlighted.
3. click the Down Arrow next to the New button; select New Menu.
4. On the Detail sheet for the new menu item, enter a value in the Menu ID field. UDXXX01 is entered for
this example.
456 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
5. In the Name field, enter Customers Overview to match the report title.
6. Enter a value in the Order Sequence field. For this example, 997 is entered which will place the new menu
item at or near the end of the current list of menu items.
7. Click the Program Type drop-down menu and select BAQ Report.
8. Click Report and then search for and choose the BAQ report. In this example, choose CustOV.
10. After giving the application about 10 minutes for a scheduled update (or after logging out and back in to
force the update), open the Customers Overview report form.
Menu Path: Sales Management > Order Management > Reports > Customers Overview
10.2.700 457
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
12. The report displays in PDF format, as it has earlier in the chapter during report development and testing.
The Epicor ERP application customization functionality enables you to add fields to form, including user-defined
fields. Within the customization itself, you can create form and row rules which run whenever users enter data
458 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
or perform other actions which activate these rules. These rules in turn launch custom events which you define
on the customization.
If you have customization rights, you have full access to all the customization tools available in the Epicor
application. Leverage this functionality to make the BAQ report an efficient and valuable reporting tool for any
business flow within your organization.
The following procedure provides an overview of the workflow for enabling and working with customization
tools.
a. When running the application with Modern Home Page interface, you can do this by expanding the
Application Bar at the bottom of the home page and selecting the Wrench icon. Alternately, from the
application Home Page, go to the Settings Page, select General Options and then select Developer
Mode.
b. If you run the application using Kinetic Home Page interface, use the overflow menu in the top right
corner of the home page window to select Developer Mode.
2. Navigate to and open the BAQ report. In this example, navigate to Sales Management > Order
Management > Reports > Customers Overview to open the BAQ report created earlier in the chapter.
With Developer Mode enabled, the Select Customization window displays. All existing customizations for
the BAQ report display. For this example, there are no existing customizations.
10.2.700 459
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
3. To create a customization from the original report form, select the Base Only check box and click OK.
4. The BAQ report form displays. To customize this form, click the Tools menu and select Customization.
5. The Customization Tools Dialog displays on top of the report form window. Notice also that a grid now
overlays on top of the report form.
460 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
6. You can now add fields, create rules, and modify the code for the report program. You access all of this
functionality within the various tabs and the Tools menu on the Customization Tools Dialog.
To learn about the customization tools, review the Epicor ICE User Experience and Customization Guide.
Multiple chapters within this book describe all of the customization tools in detail.
10.2.700 461
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
7. After you finish customizing the form, click Save on the Customization Tools Dialog.
8. In the Customization Save Dialog enter a unique Name for the customization. For this example, enter
Customers List Custom01.
462 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
9. Enter a Description that helps identify the purpose for the customized BAQ report. For this example, enter
Customization Demo.
10. Click Save. Optionally enter comments when prompted and click OK. Exit Customization Tools Dialog.
a. When running the application with Modern Home Page interface, you can do this by expanding the
Application Bar at the bottom of the home page and deselecting the Wrench icon. Alternately, from
the application Home Page, go to the Settings Page, select General Options and then clear Developer
Mode.
10.2.700 463
Chapter 3 | BAQ Report Designer Epicor ICE 3.2 Tools User Guide
b. If you run the application using Kinetic Home Page interface, use the overflow menu in the top right
corner of the home page window to select Developer Mode.
12. You now can add the customization to the application menu. Open Menu Maintenance
Menu Path: System Setup > System Maintenance > Menu Maintenance
In the Menu Maintenance tree, select the BAQ report for which you have created a customization. In this
example, navigate to and select Customers Overview.
464 10.2.700
Epicor ICE 3.2 Tools User Guide BAQ Report Designer | Chapter 3
13. On the Detail sheet, select the customization from the Customization drop-down list.
Your customized form now is applied when the report is selected from the application menu. Users within the
current company will now use this custom version of the BAQ report.
10.2.700 465
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
Chapter 4: Searches
Search programs are available throughout the application. The standard searching tools enable you to easily locate
and organize records using filters and specific criteria. In addition to the standard searches, you can also create your
own specific searches to quickly and precisely locate the information you need, where and when you need it.
Tools are available to modify search programs. Quick Searches are customized search programs you can create from
Business Activity Queries (BAQs) that pull in unique search results. BAQ Searches leverage BAQs to locate search results.
Advanced Searches are set up within a smart client dashboard; they contain specific fields you can use for defining the
search results. Use Data Tag Searches to find records grouped together through a specific data tag definition assigned
to each record. Create Named Searches that use the default options you want when the search program is launched.
The Enterprise Search is a separate search application you can use to retrieve structured content - like sales orders,
jobs, AR invoices - from your Epicor database.
This chapter explores how you can create and use these search programs, so your users can more efficiently locate the
information they need throughout the application.
You launch search programs by clicking the search buttons found on the sheets within the application. Typically,
these buttons are labeled with the primary record queried through the search program. You can also launch
some search programs by clicking the Binoculars button on the Standard toolbar.
1. In this example, the Sales Order button for the Sales Order Entry > Summary sheet displays.
2. You can also search for sales orders by clicking the Binoculars button on the Standard toolbar.
When you click the search button, the record’s search program appears. In this example, clicking the Sales Order
button launches the Sales Order Search program.
Default Features
1. The Basic sheet displays all the default options within the search program. These items are the primary fields
you can use to limit the search results.
466 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
2. Use the Quick Search sheet to find and select a quick search program.
3. The BAQ sheet contains a list of available Business Activity Queries you can use to generate the search
results.
4. The Advanced sheet contains a list of available Advanced Search options created through the Dashboard
program.
5. The Data Tags sheet contains a free-form field where you can enter one or more data tags applied to the
records for which you are searching.
6. Use the Named Search drop-down list to select a named search option. When you select a named search,
either the Basic sheet’s search options populate with pre-defined values, or the BAQ Search or Quick Search
program displays. Click the Named Search button to create Named Searches.
10.2.700 467
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
9. To pull in multiple records within the current program, highlight two or more records on the grid and then
click OK.
10. To pull in the first 100 records, click the Select 1 - 100 button.
11. To display the next set of records in the grid, click the Next 100 button.
12. Click the New Search button to clear the results and start a new search.
13. To save the current search settings but remove the current search results, click the Clear Results button.
14. You can also limit how many rows are returned within the search results. To do this, click the Options
button.
468 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
16. If you want all the available rows to display within the Search Results grid, select the Return All Rows check
box.
17. When you finish defining the search options, click OK.
18. To limit how many rows display within the Search Results grid, enter a value within the Maximum Rows
Returned field. In this example, this search program only displays the first 100 records in the Search Results
grid.
19. When you finish defining the search options, click OK.
To open the search program on any field where a search is available, press <Ctrl> + S. If data is available in the
field, the search program displays with this specific data in the Starting At field and then returns search results
based on that value. If the field is blank, the search form displays, but the search results do not return automatically.
To perform a hot key search:
1. Place your cursor in a field that has a search program and enter the data you want to use to retrieve search
results; press <Ctrl> + S on your keyboard.
10.2.700 469
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
470 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
3. The data entered into the field appears in the Starting At field.
4. The search is run and the results display in the Search Results grid.
These features are available within each search program. The rest of this chapter explains how you can modify
and personalize these search programs.
Quick Searches
The Quick Search functionality is a dynamic tool you use to create configurable searches that improve the
productivity of search results. You can privately restrict quick searches for your own user account or share them
publicly for other user accounts.
A quick search can be the default search program that displays when a search is launched either from the Standard
toolbar’s Search button or from a specific field’s search button. It can also be the primary search that displays
with other key programs near the top of a context menu. All quick searches appear on the Quick Searches sheet
within basic search programs that query similar data. Quick searches can also be used with the Named Search
feature, so you can launch a quick search immediately.
10.2.700 471
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
The Quick Search functionality is a dynamic tool you use to create configurable searches you can then use within
your own user account or share publicly for other user accounts - improving the productivity of searches.
You indicate which users can create quick searches through User Account Maintenance.
Menu Path: System Setup > Security Maintenance > User Account Security Maintenance
To give a specific user the Quick Search rights:
3. Within the Tools Options group box, select the Can Maintain Quick Search check box.
4. Select the Can Maintain Enterprise Quick Search check box to indicate this user can create quick searches
using the Enterprise Search feature. This functionality is explored later in this chapter.
472 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
This user can now create and update quick searches throughout the application.
You create quick searches through Quick Search Maintenance. To launch this program, right-click any field used
for searches and select Quick Search Entry from the context menu. In this example, you create a quick search for
Serial Tracked Parts.
10.2.700 473
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
4. To create a new search, click the New button on the Standard toolbar. Note that the System check box
is clear which indicates that this search is created by user. System quick searches are installed with the Epicor
ERP application, and Epicor recommends not to change them.
5. Enter a Quick Search ID for the quick search. This identifier displays on the Quick Search tab found within
search programs that query similar data. In this example, you enter SerialTracked.
6. Enter a Description for the quick search. This defines the concise explanation for the quick search; it also
displays on Quick Search tabs.
7. Now click the BAQ button to find and select the Business Activity Query used as the base query for the
quick search. You can use the system BAQs for the search. You can also use any custom BAQs you create.
In this example, you select EPIC03-SerialParts.
8. If you want to create a new BAQ or edit an existing BAQ, select Business Activity Query from the Actions
menu.
9. Select the BAQ column used to return the search results from the Return Column list. All the columns from
the selected BAQ display on the list. In this example, you select the Part_PartNum option.
10. The Context Key (Like) field indicates whether this quick search is linked to any other search input fields
that share the same LIKE property. If you are creating a quick search against an input field that does not
share a LIKE property with another field, the Context Key (Like) field is blank.
11. The Called From field defines the program from which this quick search pulls its data. In this example, the
quick search pulls its data from the Erp.UI.PartEntry program (form).
474 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
12. The Created by field displays the name of the user that created the quick search.
13. If you want this quick search available for all users within the company, select the Shared check box.
14. The All Occurrences check box defines where this quick search is used. When selected, the check box
indicates this quick search is available for all searches that share its Context Key (Like) property. When clear
however, the check box indicates this quick search is only available from the primary program that launches,
or calls, this quick search.
For example, you create a quick search that has Part_PartNum as its Context Key (Like) value. If you do
not select the All Occurrences check box, this quick search is only available from within Part Maintenance.
If you select this check box, however, this quick search is available when users search for parts within Sales
Order Entry, Opportunity/Quote Entry, Job Entry, and anywhere else users search for a part number value.
15. Select the Context Default check box to indicate this quick search appears with the main options at the
top of the search input field’s context menu.
16. Select the Base Default check box to indicate this quick search is the primary search program for the current
search input field. When users click the Search button on the Standard toolbar or a search button next to
a field, this quick search program displays instead of the original search program.
17. You can also use the Suppress Base check box to indicate whether the base search form is available to
users. When selected, the Base Search button does not appear on the quick search window. Users are then
prevented from displaying the original search form. To override this setting, users can press the <Shift> key
while clicking the search button; the base search form will launch instead. Suppress Base checkbox is
enabled when the Base Default is checked.
18. Select the Validation Only check box to utilize the quick search as a data entry validation tool. The
Validation Only Quick Search is used to verify, while you enter data, the new value entered into the
Context Key (Like) Data Column. When this change is sent to the database, the new value is compared
against the results of the Validation Only Quick Search. If the new value is found within the quick search
results, the data is entered into the database. If the new value is not found in the quick search results,
however, then a Quick Search Validation Exception message displays and you are not able to enter this value
into the data. For more information about creating quick search criteria, read the next Create a Quick Search
– Criteria section.
For example, you want to create a customization that only displays Cash Sales for customers from a specific
American state – Minnesota. A system Business Activity Query (BAQ) is available called zCustomer01 that
searches for these records. You decide to use a Validation Only quick search against this BAQ to validate
the customer data can only be pulled from Minnesota records. You create a quick search that has one
criterion: Customer_State Equals Constant “MN”. The Validation Only Quick Search then makes sure that
all the entered Cash Sales customer records have Minnesota addresses.
19. When you finish defining the main attributes of the quick search, click Save.
10.2.700 475
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
When you finish defining the main details of your quick search, you need to indicate which search input fields
display on the quick search form. To do this, you set up criteria for each field.
2. The first criterion you create is a check box used for finding serial tracked parts. To do this, click the New
menu.
4. Now select the Criteria Column you need. This column from the Business Activity Query is used for the
search input field. All the columns from the BAQ selected on the Detail sheet display on this list. In this
example, select the Part_TrackSerialNum column.
5. The text you enter in the Caption field displays on the quick search form. In this example, accept the default
value of Track Serial.
6. The Condition value defines how the search input field evaluates the value the user enters. The search
results that display resolve against the condition you select from this list. In this example, select = (Equal
To). Available options:
• = (Equal To) – This condition returns a search result if it is the same as the search value. This condition
also ignores trailing blanks, so “abc” is equal to “abc “. Typically, you use this condition instead of the
MATCHES condition, as this condition has better performance.
• < > (Not Equal To) – This condition returns a search result if the first expression is not equal to the
second expression.
• > (Greater Than) – This condition returns a search result if the first expression is greater than the second
expression.
• < (Less Than) – This condition returns a search result if the first expression is less than the second
expression
476 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
• >= (Greater Than or Equal To) – This condition returns a search result if the first expression is greater
than or equal to the second expression. This condition has better performance than the BEGINS condition.
• <= (Less Than or Equal To) – This condition returns a search result if the first expression is less than or
equal to the second expression.
• BEGINS (Starts with the entered value) – This condition is useful in a WHERE phrase that specifies which
records should be retrieved from within a block of records. This condition is different from the MATCHES
condition, which requires all records be reviewed by the search query.
• MATCHES (Is the same as the entered value) – A character expression you use to search on character
strings. This can include a constant, field name, variable name, or expression whose value is a character.
Note the character expression cannot have any trailing blanks; for example, “abc” does not match “abc
”.
When the Condition Value is active, users can enter asterisks (*) as wildcard search values; this indicates
any group of characters works for the search results – including a null group of characters. A period (.) can
also be used to indicate any single character can be used in that position. If you want these characters to
be literal values instead of wildcard values, enter a tilde (~) value. For example, “~*a~.b” is a match for
“*a.b”. Enter a double tilde (~ ~) to make the match pattern a literal quoted string in a procedure file.
7. Use the Criteria Type drop-down list to define the input field type that displays on the quick search.
Depending on the criteria type, a different field displays on the quick search form. In this example, select
the Prompt type. Available options:
• Prompt - Users directly enter search input values through this field. These values are then calculated
against the Condition value to generate the search results. If you use the Prompt type on a quick search,
it cannot be used as a data entry validation tool. The Validation Only check box is not available on the
Detail sheet.
• Constant - Users define a fixed value for the current criterion through this field. The quick search then
uses this fixed value to gather the search results. For example, you create a criterion that uses a constant
value of Customer_State = “MN”. This criterion causes the quick search to only find and select customer
records that have Minnesota addresses.
• Value List - This type is a field that displays a drop-down list. When you select this type, you must create
the values that display on this list using Quick Search Value Items; these items are explored later in this
section.
• Radio Set – Use this type to create a set of radio buttons for the quick search. When you select this
type, you define the radio buttons using Quick Search Value Items; these items are explored later in this
section.
8. The Criteria Value list defines the return value used to filter the search results. This is an optional value and
is active when you select the Constant option from the Criteria Type list. All the columns found on the BAQ
that were selected on the Detail sheet display.
10.2.700 477
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
9. If you want this search criterion to ignore null records, select the Filter On Null check box. This causes the
quick search to filter records that have a null value in the selected Criteria Column.
However if you want null records to display, clear this check box; only records that have a blank value display
within the results. For example, if the criterion searches by Customer_State and you clear this check box,
only customer records with blank State fields appear in the search results.
10. When you finish creating a search input field, click Save on the Standard toolbar.
11. The next search input field you create is a series of radio buttons you use to filter the quick search results
on the Manufactured, Purchased, and Sales Kit part types. To create these radio buttons, from the New
menu, select New Quick Search Criteria.
478 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
13. Enter the Caption you want to display. In this example, enter Part Type.
14. You want the search results to display the part records that match each radio button’s values. From the
Condition list, select = (Equal To).
16. Next you must define the radio buttons that display on the search form. To do this, from the New menu,
select New Quick Search Value Item.
The Value Items grid displays.
17. Enter the Display Member you want to appear next to the radio button. In this example, enter
Manufactured.
18. Now enter the Value Member used against the records to filter the search results. In this example,
manufactured parts use a value member of M, so you enter this value in this field.
19. To create a new row, press <Tab> . Add all the radio buttons you need. In this example, two other part
types are available, Purchased (P is their value member) and Sales Kit (K is their value member).
21. You need to create one more search input field that limits the results directly by part number. From the
New menu, select New Quick Search Criteria.
22. Because this search input field filters the results based on part number, from the Criteria Column list, select
Part_PartNum.
10.2.700 479
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
25. Because users directly enter values in this field, from the Criteria Type list, select Prompt.
You have now finished creating the search input fields that display on this quick search form.
480 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
Always test your quick search to make sure it is working properly. To do this, use a special command from the
Actions menu.
2. Your quick search program displays. Use the search input fields to verify the quick search works correctly.
10.2.700 481
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
Users have a number of ways to launch your quick search. You can launch quick searches from within a related
search program, from a context menu, or directly through a search button. This section explores these various
launch methods.
All quick searches that query data related to a standard search program appear on a search’s Quick Search sheet.
If multiple quick search options are available, users can select the quick search they want to display.
1. Launch the search program by clicking its specific search button. In this example, click the Part button in
the Part Maintenance program.
2. The search program displays. In this example, it is the Part Search program.
482 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
4. All the quick searches associated with the current search program display within the Quick Search grid.
5. Highlight the quick search you want to use. In this example, you select the SerialTracked quick search.
10.2.700 483
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
Quick searches can also display in two locations on a field’s context menu. They can launch from the default list
that displays at the top of a context menu; they can also display on a Quick Searches sub-menu.
To place a quick search on the default list:
2. Click the Quick Search ID button to search for and select the quick search you wish to modify.
4. Click Save.
484 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
8. The quick search appears within the list of the default Open With programs. Select this command so that
the quick search displays.
You can also set up the quick search to become the default search program. This causes your quick search to
display instead of the original search program.
10.2.700 485
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
2. Click the Quick Search ID button to search for and select the quick search you wish to modify.
4. Click Save.
486 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
10.2.700 487
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
Business Activity Queries (BAQ) are used throughout the application to search for related data. You create BAQ
Searches in the Business Activity Query program by selecting “Like” columns. When fields in your query are
selected as “Like” Columns and this same field is used for searching in various programs, the BAQ becomes an
option within the search program.
You can indicate data from your query is available to all users searching for related data on the BAQ Search sheet.
You select fields from the Available “Like” Columns list and move them into the BAQ “Like” Columns list.
Available features:
• The Available “Like” Columns list contains all the fields selected for your query on the Display sheet.
• The BAQ “Like” Columns list displays the items you move over from the Available “Like” Columns list. Users
searching for information similar to the data contained in the BAQ “Like” items can access your BAQ Search.
Many standard search programs throughout the application contain a BAQ sheet that makes your query available
when users search for related data.
In the previous chapter, you created a new query called EPIC03-SalesInfo that displays sales order information.
You decide you want users to access this query from the Customer Maintenance and Sales Order Entry programs
so they can look up data related to customer and sales order numbers.
Menu Path: System Management > Business Activity Queries > Business Activity Query
1. In the Query ID field, enter the query. In this example, you enter EPIC03-SalesInfo.
488 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
2. Verify the Shared check box is selected. The query must be shared in order for your users to access this
BAQ from a search form.
10.2.700 489
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
4. Select the “like” columns used for the BAQ search. In this example, you select the Customer.CustID field in
the Available “Like” Columns list.
490 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
6. The selected field moves to the BAQ Search “Like” Columns list.
7. In this example, you also select the OrderHed.OrderNum field and move it to the BAQ Search “Like”
Columns.
8. Click the Save button on the Standard toolbar to save the query.
Once the BAQ Search information is saved, you can now leverage this BAQ in searches that use the Customer
ID and the Sales Order Number fields. For example, this query is now available when you search for sales orders
10.2.700 491
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
in Sales Order Entry and when you search for Customer IDs within Customer Maintenance. During this example,
you launch the BAQ Search within Sales Order Entry.
Menu Path: Sales Management > Order Management > General Operations > Order Entry
1. Click the Sales Order button to launch the Sales Order Search form.
3. Select CustomerOrders.
492 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
Advanced Searches
An Advanced Search is a dashboard you access to search for related data from a standard search window.
The Advanced Search functionality is designed around the concept of “Like” columns. Similar to the “Like”
columns used in a BAQ Search, the Advanced Search also uses “Like” columns; however, the data displays as a
Dashboard and opens in a separate window. You can then use the dashboard to search for specific data, select
a record, and pull the record back to the original program from which you were searching.
Advanced Searches are available wherever you can launch a search window. You launch these programs either
by clicking a search button or from a context menu.
10.2.700 493
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
Advanced Searches are accessed through the search button in many programs or through a field’s context menu.
In this example, the Sales Order Entry program is used to demonstrate how you can access an advanced search.
Menu Path: Sales Management > Order Management > General Operations > Order Entry
5. The Fulfillment Workbench Search dashboard opens in a new window on your workstation.
6. You can now use the dashboard to search for specific records using the criteria available on the window.
In this example, you want to search for sales orders for the Distribution Product Group. You select Distribution
from this list.
7. Click the Search button to retrieve the records that match the criteria.
8. The results display in the Open Sales Order Release Search grid.
9. Once you find the record for which you are searching, select it in the grid.
11. The record selected in the dashboard displays in Sales Order Entry and you can now modify the sales order
as you need.
12. You can also right-click a field to access a Search (and any defined advanced searches) from the context
menu.
Named Searches
Use a Named Search to create a series of pre-set search options. In the Sales Order Search program, for example,
you can create a Named Search that only pulls in open orders created for Bill To customers. You could also create
a Named Search that automatically launches a BAQ Search or a Quick Search.
You use named searches in several ways. You can launch these searches manually from the Named Search
drop-down list within each search program. A specific Named Search option can be the default for the search
program; each time you launch the search, the Named Search options display. You can also set up Named
Searches to automatically populate data within either the search program or its parent program.
494 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
10.2.700 495
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
5. Click New.
6. Enter a Named Search ID for your new named search. In this example, you want to create a search that
pulls open sales orders and sorts them by their Purchase Order Numbers. Enter OPEN in this field.
8. The Application field displays the program for which you are creating the named search. In this example,
Erp.UI.SalesOrderEntry.dll displays.
9. The Search Form field displays the name of the search program being modified. In this example, Sales
Order Search displays.
10. Select a Search Type for this named search. Available options:
• Basic Search – Use this search type to modify the default values on the search program’s Basic sheet.
When you select this option, the search form’s Basic sheet displays.
• BAQ Search – Use this search type to select a Business Activity Query to populate the named search.
To learn how to create these search programs, review the BAQ Searches section in this chapter.
• Quick Search – Use this search type to select a Quick Search that populates the named search. To learn
how to create these search programs, review the Quick Searches section found in this chapter.
496 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
11. If you select either the BAQ Search or Quick Search type option, the Search Using drop-down list displays.
This list displays all the BAQs or Quick Searches available for this search program. Select a search option you
want from the list.
12. In this example, however, you are defining options for the Basic Search type.
10.2.700 497
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
13. When you select this Search Type, the Basic sheet from the current search program displays.
14. Enter the default values you want for this named search. In this example, you want the results sorted by
purchase order, so from the Sort By field, select PO Number. You also want only open orders created for
sold to customers to display; these business entities are the customers that purchased the goods. Bill To
customers are the business entities who pay for the goods.
Now you can select several options for the named search. These options affect how the named search runs when
it activates. To define these options:
2. Select the Default check box if you want this named search to be the default for the current search program.
3. When the Default check box is selected, the Auto Execute check box becomes available. Selecting this
check box causes the search program to run when the search program launches, automatically populating
the Search Results grid with data.
4. When the Auto Execute check box is selected, the Unpin Criteria Sheet check box becomes available.
Selecting this check box causes the main search sheet to automatically hide; only the populated Search
Results grid displays.
498 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
5. When the Return All Rows check box is selected, the Search Results grid displays all the data that matches
the options within the named search.
6. If you clear the Return All Rows check box, however, the Maximum Rows Returned field becomes available.
Enter the highest number of rows you want to display within the Search Results grid. In this example, this
named search displays a maximum of 1,000 records (rows).
7. Select the Single Value Auto Select check box to indicate that if the search program only locates one
record, this record automatically populates within the maintenance or entry program.
10. You can now see this search program in action. Click the Sales Order button.
10.2.700 499
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
11. The Sales Order Search window appears, using the named search options you selected. Notice in this
example, the search program automatically populates the Search Results grid with open orders, sorting
them by PO Number.
12. It also hides the Search program’s main sheet; these options are now a sheet at the top of this window.
Each time you launch this search program, it displays using these options.
You can also personalize each program to automatically load in all the records selected through a named search.
You can then immediately populate a maintenance or entry program with the data you want.
To personalize a program to do this. In this example, you use Sales Order Entry:
500 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
3. Notice the As the Form Opens group box. The options in this group box define some actions that run each
time you launch the program.
10.2.700 501
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
4. Select the Auto Populate Data radio button. This indicates you use a named search to automatically
populate the current program with records.
5. The drop-down list below the Auto Populate Data radio button becomes active. All the named searches you
have created for this program display on this list. In this example, you select the OPEN named search.
6. Click OK.
7. Now close and reopen the Sales Order Entry program you just personalized.
8. Now each time you launch this program, all the open sales orders automatically populate within the program.
You can use the Navigation toolbar to find and select the order you need.
You can define a similar default action using the Auto Load Search option. You also set up this value within the
Options window.
502 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
3. Select the Auto Load Search radio button. This indicates you want the search program to automatically
display each time you launch the program.
4. The drop-down list below the Auto Load Search radio button becomes active. All the named searches you
have created for this program display on this list. In this example, you select the OPEN named search.
10.2.700 503
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
5. Click OK.
6. Close and reopen the Sales Order Entry program you just personalized.
7. Now each time you launch this program, the Sales Order Search program automatically displays.
8. Notice that, by default, the named search’s options display within the Basic tab.
504 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
You can always restore the original search program. To do this, press the <Shift> button on your keyboard and
then launch the search program. The original search program appears – displaying its Basic sheet. You can then
select any Named Search, BAQ Search, Quick Search, or Advanced Search created for this search program.
Use Data Tag Searches to find and select records grouped together by private or shared tags.
Tags are unstructured text values that provide a way to associate otherwise unrelated records so that you or
other users can search for them. For example, you may have a group of customers you want to review on a
regular basis. You can create a private data tag for your important customers called “XXXImportant” (where
“XXX” is your initials) and use the Data Tag Search from Customer Maintenance to retrieve all the records at the
same time. You might also want to group a number of sales orders for review by someone else. You can apply
a public data tag called OrderReview that a sales manager can use from Sales Order Entry.
Private data tags are associated with your user account. Other users cannot retrieve records using your private
tags and, likewise, they cannot see or edit them. Public data tags can be viewed and used in Data Tag Searches
by all users. You can add as many data tags as needed to a record, each separated by a space. However because
the tags are space delimited, you cannot include a space as part of a data tag.
You can add data tags to any record throughout all the programs in the application. In this example, Customer
Maintenance is used to demonstrate how you can add data tags to a record.
Menu Path: Sales Management > Order Management > Setup > Customer
1. Click the Customer search button and retrieve one or more records.
10.2.700 505
Chapter 4 | Searches Epicor ICE 3.2 Tools User Guide
2. Right-click the main field; from the context menu, select Tag Record.
506 10.2.700
Epicor ICE 3.2 Tools User Guide Searches | Chapter 4
4. To add a private data tag—one for your use only—enter the data tag value into the My Tags field. If other
tags are already in the field, add a space and then the new tag.
5. To add a shared data tag—one that can be used by others—enter the data tag value into the Shared
Tags field.
6. Click OK.
7. You return to the Customer Maintenance window. You do not need to save the record for the tag to be
in effect.
1. To add a tag to some, but not all, of the records in a grid, select one or more records. Yo