# Epicor BPM Runtime Error: Where to Look and How to Fix It

> Source: https://netray.co/erp-help/epicor-bpm-runtime-error-fix
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: ERP Help

## Short answer

A BPM runtime error is an exception thrown while a directive runs, so the user's save or action fails. Find the directive name and line in the client trace or server log, then check the usual causes: a null reference in custom code, a directive that no longer compiles after a change, conflicting directive order, or a lock or validation error from a nested update.

## Kind

error

## System

epicor

## Erp

Epicor Kinetic

## Module

BPM / Troubleshooting

## Query

epicor bpm runtime error

## Alternate Queries

- epicor bpm object reference not set to an instance of an object
- epicor bpm compile error directive
- epicor bpm directive not firing
- epicor bpm error in server log

## Applies To

Epicor Kinetic and 10.x, Method and Data directives, on-prem and cloud (cloud log access differs).

## Steps

### How to diagnose a BPM runtime error

**Items:**

- Reproduce the action with the client trace on (Options > Tracing Options) and note the exact error text the user sees.
- Copy the Details of the error dialog. It usually names the business object, method and sometimes the directive.
- On-prem, open the server log location configured in the Epicor Administration Console for the app server, and the Windows Event Viewer on the app server, and search for the timestamp.
- Open Method Directive Maintenance, find the directive, and check it is Enabled and which directive group it belongs to.
- Disable the suspect directive in the pilot company and retry. If the error disappears, the directive is confirmed as the cause.
- Fix the code or the logic, validate, save and deploy, then retest with the same data.
- Re-enable in live only after a pilot company run.

## Sections

### The usual causes

**Body:**

Null reference is the number one cause. Code such as Db.Part.Where(...).FirstOrDefault().PartDescription throws when no row matches, or when a ttTable has no row for that RowMod. Always test for null before use, and check the table has rows before calling First.

The second is a directive that stopped compiling. A schema change, an upgrade, a renamed UD field or a removed widget can leave a saved directive that no longer builds. After an upgrade, open key directives and validate them.

Third is directive order and conflicts. Several directives on the same method run in sequence, and one can change data that the next one assumes. Review the directive groups and order numbers when two rules touch the same field.

### Where the error is recorded

**Body:**

The user-facing dialog shows a short message and a Details view with the stack. The server side keeps more: the application server log set up in the Epicor Administration Console, and the Windows event log. The exact paths depend on how your server was installed, so ask your Epicor administrator for the log location rather than guessing.

The client trace is the quickest tool when you cannot reach the server: it records the calls and responses so you can see which method failed and the returned error. Turn it off afterward because it adds overhead.

### Defensive patterns that prevent repeats

**Body:**

Wrap lookups in null checks, write explicit exception messages naming the part, order or line, and keep each directive small. A short message such as Part X is inactive on line 3 saves hours compared with a stack trace.

For multi-step logic use an Epicor Function and a single call widget, so the logic can be tested alone and reused. Keep custom code out of high-traffic methods unless it is guarded by a condition.

**Code:**

var cust = Db.Customer.Where(c => c.Company == Session.CompanyID && c.CustNum == ttOrderHed[0].CustNum).FirstOrDefault();
if (cust == null)
{
    throw new Ice.Common.BusinessObjectException("Customer not found for order " + ttOrderHed[0].OrderNum);
}

## Pitfalls

- Fixing the symptom in the live company without a pilot test. A new bug can stop all order entry.
- Assuming the error comes from the screen you used. It may come from a directive on a method the screen calls indirectly.
- Leaving old test directives enabled, so they fire in the wrong company.
- Reading only the first line of the dialog. The Details usually have the actual line and cause.

## Ai Angle

An assistant that can read the exported error text, the directive definitions and your schema can narrow the likely cause, for example pointing at the FirstOrDefault that has no null test. It suggests; your developer changes and tests. Running the model on-prem keeps stack traces and customisations inside your network.

## Faq

### What does Object reference not set to an instance of an object mean in a BPM?

**Answer:** Your code used a value that was null, usually a database lookup that found nothing or a temp table with no matching row. Add a null check and a clear error message before using the object.

### Why does my BPM stop working after an upgrade?

**Answer:** Schema or API changes can break compilation of custom code or widgets. Open the directive, validate it, correct any renamed fields, save and deploy again. Review upgrade notes for removed or changed members.

### Can I see which directive threw the error?

**Answer:** Often yes from the Details of the error dialog and the server log. If not, disable directives one at a time in a pilot company, starting with the ones on that business object and method.

### How do I stop one bad directive blocking everyone?

**Answer:** Disable it in Method Directive Maintenance, then deploy. Fix it in a pilot company with the same data before enabling again in the live company.

## Search terms

epicor bpm runtime error, epicor bpm error, epicor object reference not set bpm, epicor directive compile error, epicor bpm server log, epicor bpm not working, epicor method directive error, epicor kinetic bpm troubleshooting

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
