XtendM3 tables and transactions without a Groovy developer

· Stewart Rutledge

XtendM3 is one of those parts of Infor M3 that is very powerful and a little intimidating if you aren't a developer. It's where M3 lets you change the business engine itself: new API transactions, your own tables and logic that runs when something happens in M3. It also means Groovy, the XtendM3 framework and a good understanding of M3's internals, which is why it's the part most teams can't staff.

This article goes through what XtendM3 is for, why most of the work is really about data, and how you can design tables and transactions, and get them approved by Infor, without writing the Groovy yourself.

What XtendM3 is for

XtendM3 is Infor's framework for extending M3's business logic. An extension is Groovy code that runs inside M3, and Infor publishes the XtendM3 documentation and programming standard it has to follow. There are three things you build with it:

  • Transactions. Your own API transactions, grouped under a program the way standard MI programs are. They read and write exactly the fields you choose, so an integration or an H5 app gets the data in the shape it needs.
  • Tables. Extension tables for data that has no home in standard M3, with the keys and fields you design.
  • Triggers. Logic attached to standard M3 events, to validate, default or extend behaviour where it happens. Because it runs in the business engine, it holds no matter which screen or integration made the change.

Your XtendM3 administrator deploys the finished extensions to M3.

Why XtendM3 work is data work

You're not really writing an MI transaction. You're deciding which fields it reads, what the keys look like and what happens when a value is missing. Those are decisions you make by looking at real data, not by remembering what a table is supposed to contain.

Which fields are actually filled in? What are the custom fields your business added really called? Is the key you assumed unique? Normally you find out by deploying something and seeing what comes back, and every round of that is a deploy.

In Loupe Code the data sits next to you the whole time. It queries your environment, shows you what it found and designs the extension against that. When two transactions could both do what you asked, it stops and asks which one you meant. Nothing has to be deployed while you're still working it out.

Building a table, then a transaction against it

Here's how a small set of extensions comes together, before any of it exists in M3.

Start with the table

We prompted: "A table for storing temporary customer orders before moving them into normal batch orders." What came back was a table with a reasonable set of fields and keys for that job. Adding, changing or removing columns works by prompting or directly in the interface, with the data in view.

Then the transaction

Next we prompted: "A transaction that updates or adds records in the table EXT300." EXT300 wasn't deployed anywhere yet. Loupe Code looked in the local workspace, found the table and wrote the transaction with the right field names and data types. When you add or change a column later, you ask it to update the transaction to match, and it does.

That's the part that usually takes several rounds with a developer: the table is designed, deployed and checked, and only then does the transaction get written against it. Here both are worked out together, and deployment comes once they agree.

A transaction with its own rules

A transaction can carry real logic too. We prompted:

"An API that takes a role name and checks that the role exists in M3 and that the calling user has it. Return 'permitted' as a boolean, plus a 'reason' field that says whether the role was missing or the user lacked it."

That generated a working API following those rules, with clear comments, usable right away. It's a typical building block: an H5 app or an integration can call it before it shows or does something.

A new transaction can also start from the source code of an existing M3 program, when the logic you need is close to something M3 already does.

What you end up with

What Loupe Code produces is standard XtendM3: Groovy source that follows Infor's practices, that you can read, review and hand to a developer. Transactions belong to their program, so a set of related extensions stays together. The source can be synced to your own git repository, and nobody has to keep paying us to change it later.

A new transaction usually wants a screen, and you can build that from the same place. See building an Infor M3 H5 app from a description. And if the rule only has to hold where users type a value on one panel, an H5 script is cheaper than a trigger; there's an example in blocking an M3 order when a custom field is empty.

Getting XtendM3 extensions approved by Infor

Before extensions go into a production tenant, Infor reviews and approves them. Putting that package together by hand is its own small project.

Request approval in Loupe builds the package Infor needs:

  1. You choose which extensions go in this request.
  2. Loupe reviews only what's new or changed.
  3. It says what to fix, finding by finding, so you can deal with them one at a time.
  4. It fills in the developer and the repository for you.

Questions we get

Do I need to know Groovy?
No. You describe the table, transaction or trigger and review what Loupe Code builds. The source is readable Groovy, so a developer can review it or take it further if you want one to.

Does it use our custom fields and tables?
Yes. Loupe Code reads your environment, so it designs against your real tables, custom fields and transactions under the names they have in your M3.

Who deploys the extensions?
Your XtendM3 administrator, the same way as any other extension. Nothing is installed in M3 until you do it.

Have a transaction the integration team has been waiting on, or a trigger that should have existed years ago? Send it to hello@loupeapp.net, and read more about XtendM3 in Loupe Code.

This article started as a post on LinkedIn. Join the conversation there.

Got something on your M3 backlog?

Send it our way and we'll show you what Loupe Code does with it, on your own M3.

XtendM3 tables and transactions without a Groovy developer