Help with BPM to Show Warning When Reopening Line or Release

Hi all,
I’m working on implementing a Business Process Management (BPM) directive in Epicor Kinetic, and I need some guidance.
The requirement is:

To display a warning message whenever a user reopens a Sales Order Line or Release — specifically when the OpenLine or OpenRelease fields are changed from false to true.
So far, I’ve attempted a Pre-Processing Method Directive on SalesOrder.Update using custom C# code to detect when OpenLine is set to true, and then check for related closed OrderRel records. However, the warning does not show at all when users use the “Actions → Reopen Line” or “Reopen Release” functionality in the Kinetic UI.

foreach (var ttRelRow in ttOrderRel)
{
    // Only check updated rows
    if (ttRelRow.RowMod == "U")
    {
        // Check if OpenRelease changed from false to true
        bool wasClosed = false;

        using (var txScope = IceContext.CreateDefaultTransactionScope())
        {
            var currentRel = Db.OrderRel
                .Where(rel =>
                    rel.Company == Session.CompanyID &&
                    rel.OrderNum == ttRelRow.OrderNum &&
                    rel.OrderLine == ttRelRow.OrderLine &&
                    rel.OrderRelNum == ttRelRow.OrderRelNum)
                .FirstOrDefault();

            if (currentRel != null && currentRel.OpenRelease == false)
            {
                wasClosed = true;
            }
        }

        // If release was previously closed and now open
        if (wasClosed && ttRelRow.OpenRelease == true)
        {
            string msg = $"Warning: You have reopened Release #{ttRelRow.OrderRelNum} on Line {ttRelRow.OrderLine}. Ensure this is intentional.";
            ExceptionManager.AddWarning("ReopenReleaseWarning", msg);
        }
    }
}

any help will be highly appreciated

This is one of those times where a widget function would be easiest to implement and understand. Add a conditional where your OpenLine/OpenRelease fields are changed from false to true. Then show a message if the condition is true.
@JasonMcD is your widget expert here :grin:

Is this a person…?

But yeah agreed, there’s a simple condition in the condition widget for value changed “from any to another” or something.

I guess you would not want to include added rows as I assume those would trigger the error of no rows in the dsSomething table or whatever.

I’ve this flow, don’t what I’m missing



OK, I’m a little lost.

You are checking on reopened lines, right?

And then it seems like you are checking if any releases are still closed even though the line is opening?

But if you reopen a line, the releases are always all still closed, right?

I’m not familiar with the problem you are trying to solve I guess.

1 Like

You have separate events for reopening so I would look at those first before using Update:
SalesOrder.ReopenOrder
SalesOrder.ReopenOrderLine
SalesOrder.ReopenRelease

1 Like