How to Create a BAQ in Epicor Kinetic
how to create a baq in epicor kinetic
Also searched as
- epicor kinetic query builder
- epicor baq tutorial
- build a business activity query epicor
Short answer
A BAQ (Business Activity Query) is a saved query in Epicor Kinetic that you build in the Query Builder without writing SQL. Choose the tables, define joins, select display fields, add criteria and calculated fields, test the result, then use the BAQ in dashboards, reports, BPMs or the REST API.
Applies to: Epicor Kinetic (and recent Epicor ERP 10 releases). Menu paths and tab names vary slightly by version, search the menu for Query Builder or BAQ.
Build your first BAQ
- 1Open the Query Builder (use the menu search for Query Builder or Business Activity Query) and click New.
- 2Give the query an ID and description, choose its scope (company or system) and whether it is shared.
- 3On the Phrase Build or table area, add the tables you need, starting with the main table such as JobHead or OrderHed.
- 4Add related tables and set the joins, being careful to use inner joins only when a match is required and left outer joins otherwise.
- 5On the Display Fields area, select the fields to show, set column labels and ordering.
- 6Add criteria on table fields (for example open jobs only) and consider parameters if the user should be asked.
- 7Add calculated fields where needed, for example a margin or an age expression.
- 8Analyze and test the query, fix errors, then save and generate it.
- 9Use it in a dashboard, a BAQ Report, a BPM, a function or the REST API.
Design choices that matter
Start from the table at the grain you want in each row. If you want one row per job operation, start from JobOper, not JobHead. Joining upward to headers is cheap, joining downward multiplies rows and can inflate totals.
Filter as early as possible with table criteria rather than relying on a dashboard grid filter. A BAQ that pulls every historical row and filters on screen will be slow and put load on the database. Our page on slow BAQs goes through this.
Calculated fields and parameters
Calculated fields use an expression language that is close to SQL, built from fields in the query. Keep them simple and avoid heavy logic that belongs in a function. For user prompts, define a criteria value as a parameter in the query so dashboards and reports can ask for it.
Test with realistic parameters. A BAQ that works with one job can behave differently over a year of data.
Publishing and security
A BAQ is available to users who have access through its security settings, and a menu or dashboard may be needed to expose it. Treat BAQs that expose cost or pricing data like any other sensitive screen, and check company scope in multi-company installations.
Where you need the same data programmatically, the BAQ can be called through the REST API or from a function, which is covered in our Epicor function pages.
Try it here, free
Epicor BAQ Calculated Field Examples Reference
A searchable cheat sheet of BAQ calculated field expressions you can copy into the Query Builder, grouped by dates, quantities, pricing and text.
Common pitfalls
- !Starting from the wrong table and getting duplicated rows or inflated totals.
- !Using inner joins where optional data exists, silently dropping rows.
- !Skipping criteria and pulling years of history into a dashboard.
- !Forgetting to regenerate the BAQ after changes, so users see the old definition.
How an ERP-grounded AI assistant handles this
A grounded assistant can draft the table and join choices for a BAQ from a plain-language request, and explain an existing BAQ to a new analyst. Netray's ERPray can also answer many ad hoc questions without anyone building a BAQ, read-only against your Epicor data, including on-prem.
Frequently asked questions
What is a BAQ in Epicor?
A Business Activity Query is a saved query built in the Query Builder. It selects data from Epicor tables and can be used in dashboards, reports, BPMs, functions and the REST API.
Do I need SQL to create a BAQ?
No. The Query Builder is visual. Knowing the table structure and basic join logic helps, and SQL-like expressions are used in calculated fields.
Can a BAQ update data?
Updatable BAQs exist and can write to certain tables, but they bypass some business logic, so use them sparingly and with care.
Why is my BAQ slow?
Usually missing criteria, joins that multiply rows, or heavy calculated fields. Narrow the data early and test with production-sized data.
Related
Fixing a Slow Epicor BAQ (Business Activity Query)
A slow BAQ in Epicor is usually caused by unindexed join columns, a subquery or calculated field forcing a table scan, or the BAQ pulling far more rows than the dashboard actually displays before filtering client-side. Fix it by reading the SQL Server execution plan Epicor generates, moving filters into the BAQ criteria instead of the dashboard filter panel, and replacing subqueries with joins where possible.
How-toHow to Add a Calculated Field in an Epicor BAQ
In Epicor Query Builder, open the Phrase Build or Calculated Fields area of the Analyze tab or Display Fields, add a new calculated field with a name and a data type, and write a SQL expression that references columns as Table_Column. Guard against NULL and zero divisors, and use a subquery when the value needs its own aggregation.
How-toEpicor Function: How to Call a BAQ from C# (Functions and BPM)
To run a BAQ from an Epicor Function or a BPM code block, call the Dynamic Query service: get the query's execution parameters by BAQ ID, set any parameter values, run it with the execute-by-ID method, and read rows from the results table. Declare the service in the function so the platform can resolve it.
How-toHow to build a Kinetic homepage dashboard in Epicor
Kinetic homepage dashboards are built from Active Homepage Maintenance: create a BAQ that returns the metric or list you want, add a KPI or List widget referencing that BAQ, arrange widgets on the homepage layout, and assign the homepage to a role or company so the right users see it.
Error fixFixing Epicor BusinessObjectException: BPM Directive Errors
A BusinessObjectException that says "A Business Process Management (BPM) directive has raised the following error" means a directive on that business object stopped the transaction, either deliberately via a Raise Exception widget or accidentally via an unhandled .NET error in Custom Code. Expand the InnerException on the error dialog to see the real message and the directive name, then open BPM Designer for that object and method to find the widget that fired.
How-toEpicor MRP Runs but Generates No Suggestions
When Epicor's MRP process completes without a job or purchase suggestion for a part you expect one for, the cause is almost always the part's own configuration (Part Class Type, Make Direct, Non-MRP flag, planning Time Fence) or the demand not being linked in a way MRP recognizes, not a defect in the MRP engine. Work through the part's Planning tab, its safety stock and lead time setup, and the demand source (sales order line status, job material requirement) before assuming the run itself failed.
AI for ERPAI for Epicor Kinetic, Beyond What Prism Covers
Add AI to Epicor Kinetic beyond Prism: private LLM over BAQs, BPM data, and REST v2, on-prem or private cloud, with honest guidance on when Prism already covers you.
Stuck on Epicor Kinetic?
Talk to engineers who work inside Epicor Kinetic every week, and who build private AI that answers these questions from your own ERP data.
Keep exploring
Free tools
- Epicor BAQ Calculated Field Examples ReferenceA searchable cheat sheet of BAQ calculated field expressions you can copy into the Query Builder, grouped by dates, quantities, pricing and text.
- Epicor BAQ Query Template GeneratorFill in company, days back and status filters to get a starter SQL for an open jobs BAQ, plus a design checklist for the Query Builder.
- Epicor BAQ Performance Tuning ChecklistWork through a practical list of checks when a BAQ, dashboard or BPM lookup runs slowly in Epicor Kinetic.
ERP fixes and how-tos
- How to Create a BAQ in Epicor: Build, Run, Search, Export to Excel and PublishStep-by-step: create a BAQ in Epicor Query Builder, add tables and criteria, run and search it, export to Excel, and publish it as a dashboard.
- How to Add a Calculated Field in an Epicor BAQAdd a calculated field to an Epicor Kinetic BAQ: syntax, CASE, NULL and divide by zero guards, date math and when to use a subquery instead. Working examples.
- Fixing a Slow Epicor BAQ (Business Activity Query)A slow Business Activity Query in Epicor is almost always an execution plan problem, not an Epicor problem. Here is how to find the real cause and fix it without rewriting the BAQ from scratch.
AI on your ERP
- Private AI for Epicor Kinetic Cloud, Outside the Multi-Tenant BoundaryRun a private LLM on Epicor Kinetic private cloud or Kinetic Cloud data via BAQs, REST v2 and Data Fabric, keeping sensitive manufacturing data off shared AI.
- AI for Epicor Kinetic Job Shops: Quote History, Job Variance and Schedule RiskPrivate AI for Epicor Kinetic job shops: quote-to-job history, JobHead and JobOper variance, subcontract delays and schedule risk, via REST and BAQs.
Integrations
- How to connect Power BI to Epicor KineticConnect Power BI to Epicor Kinetic using BAQ OData feeds, a data warehouse or a SQL replica, with an on-prem gateway, key dashboards and natural-language Q&A.
- How to use Claude with Epicor KineticUse Claude with Epicor Kinetic through an MCP connector, the Anthropic API, AWS Bedrock or Google Vertex, plus the private on-prem alternative for sensitive data.