Epicor Kinetic SaaS Linux Hosting: Why Some Passing Code Now Fails

A quick fix for enumerable queries that pass syntax checks but fail after the move from Windows to Linux hosting.

Epicor has been transitioning Kinetic cloud technology from Windows-based containers to Linux as part of its SaaS hosting modernization. For most users, this change is invisible. However, some custom code in BPMs, Functions, and related server-side logic may behave differently even though the same code ran successfully on Windows and still passes Epicor syntax checks.

What Changed?

The issue appears when code relies on an enumerable query being iterated later without first committing the query results to memory. Under the previous Windows hosting environment, that pattern may have worked. Under Linux hosting, the same deferred enumerable query may not iterate as expected.

This can be confusing because the code is not necessarily syntactically wrong. Epicor may accept it during validation, yet the logic can fail at runtime after the SaaS environment is moved to Linux.

The Symptom

You may see code that retrieves data through a query, passes syntax validation, and worked previously, but now produces unexpected results or fails when the results are looped through. The common thread is deferred execution: the query has been defined, but the result set has not yet been materialized.

The Fix: Materialize the Query with .ToList()

The correction is usually simple: call .ToList() on the query before iterating it. This forces the query to execute immediately and stores the results in memory as a list. Microsoft’s LINQ documentation describes ToList() as a method that forces immediate query evaluation and returns a list containing the query results.

Instead of looping directly over a deferred query, materialize it first:

 

Before

var results = Db.SomeTable.Where(row => row.Company == Session.CompanyID);
foreach (var row in results)
{
    // process row
}
 

After

var results = Db.SomeTable.Where(row => row.Company == Session.CompanyID).ToList();
foreach (var row in results)
{
    // process row
}
 

Why This Works

Many LINQ queries use deferred execution. That means the query is not actually run when it is assigned to a variable; it runs when the code starts enumerating the results. Calling .ToList() changes that behavior by running the query immediately and creating a stable in-memory collection before the loop begins.

Recommended Action

If your Epicor Kinetic SaaS environment has recently moved from Windows to Linux hosting, review custom BPMs, Functions, and server-side code for enumerable queries that are iterated without first being committed to memory. Where appropriate, add .ToList() before the loop or any repeated enumeration.

This small change can resolve code that passes syntax checks but fails at runtime in the Linux-hosted SaaS environment.

 

Next
Next

Properties, Properties, and more Properties: How to Set Properties in Epicor Kinetic