Event Rules, Named Event Rules and Business Functions translated into X++

The statement-by-statement translation from JD Edwards Event Rules and C Business Functions into X++ - Table I/O to the select family, Transaction Boundaries to ttsbegin/ttscommit, Company and Business Unit filtering to DataAreaId and RecId - and a full worked example converting a direct Event Rules edit into a Chain of Command extension.

What you will be able to do

Introduction

The first chapter of this domain was about a rule and the architecture it produces. This chapter is about the day job: the statements you type, and the events you hook logic to.

Event Rules, Named Event Rules and Business Functions: the 4GL and its compiled floor

JD Edwards actually asks you to think in three cooperating layers, not one language. Event Rules (ER) is a visual, tree-based rule language, edited in a flowchart-style designer and attached directly to a form, control, grid or report-section event.

Table I/O: from Select and Fetch Next to the X++ select family

firstonly plays the role of Fetch Single, and the result is read straight off the table buffer - inventTable.ItemId, inventTable.RecId, and every other field are populated after the select, with no separate Data Structure to unpack.

Transactions: Transaction Boundaries versus ttsbegin and ttscommit

JD Edwards demarcates a multi-statement unit of work with Begin Transaction Boundary and Commit Transaction Boundary, business functions that wrap the underlying JDB commitment-control API, with Rollback Transaction Boundary available when something fails partway through.

Keys and scoping: Company, Business Unit, DataAreaId and RecId

Here the direction of the difference reverses from what you might expect. JD Edwards has no automatic runtime enforcement of company scoping at all. Every Select, Fetch and Business View that must stay within one company relies on a developer remembering to filter by Company (data item CO) or by Business Unit (MCU, itself tied to a…

The event model: forms, grids and business functions versus event handlers and delegates

JD Edwards attaches Event Rules directly to named events: Form - Post Dialog Initialization when a form opens, Control - Post Button Clicked after a button's own processing runs, Grid - Row Is Exited when focus leaves a grid row, and a Business Function call anywhere logic needs to be shared.

Chain of Command, properly: from a direct Event Rules edit to validateWrite

The instinct to retrain is specific: a JDE developer's habit for "add a check before this record saves" was to open the standard object's Event Rules for the relevant event and insert new logic directly into the same flow as Oracle's own rules - anywhere in that flow, interleaved with the vendor's steps, with nothing enforcing where your…

The Data Dictionary versus Extended Data Types

JD Edwards' Data Dictionary is the one architectural idea in this whole domain most worth mourning honestly. A Data Dictionary item - alias AN8 for Address Number, MCU for Business Unit, OBJ for Object Account - is not just a shared definition of type, length and label.

Knowledge check

Summary

X++ is close enough to Event Rules and Business Functions in spirit - table-centric, transaction-aware, strongly typed - that the syntax is learnable quickly. The genuine work is building instincts EnterpriseOne's interpreted layer never required: reaching for a set-based statement by default, trusting an enforced company boundary…