Potato IT

XtendM3

Over the last few weeks I’ve been working on refactoring some extensions. A couple of these have been XtendM3 extensions and I thought I’d share some of my experiences.

For those of you that haven’t come across XtendM3 before, it is a M3CE technology that allows us to change the behaviour of the M3 Business Engine. It allows us to hook in to exit points within the M3BE code and manipulate results, it allows us to read and write directly to the M3 database, create new tables and create new APIs. XtendM3 extensions are written in Groovy which is a language based on Java. This is a technology that runs on the server.

Because this code can manipulate M3BE directly there’s a few things that currently have to be done.

  1. You have to request that XtendM3 is enabled on your tenants
  2. To deploy your XtendM3 extension to your production tenant, you must have it reviewed and signed by Infor. Though I had a very quick turn around on my development, I would suggest that if you are estimating timelines, it would pay to add buffer incase you need to rework

This of-course is on top of writing good code 🙂

This post focuses really on my recent experience using a trigger.

General

The first thing that I’ll say is that the Xtend team have really put a lot of work in to making development and source control really easy, take advantage of the resources that they have provided 🙂

Source Control

Source control is important for version control and generally should be used. It is currently required for signing. You can clone the Xtend teams example repository at https://github.com/infor-cloud/acme-corp-extensions

Logging

Those of you that have read my posts in the past will know that I’m a big fan of logging information on the code execution, especially when it is challenging or not possible to use debugging. But with XtendM3 we are logging in to the BE logs, the BE logs that are monitored by CloudOps (can you see where this is going? :-O)

During the process of uplifting an extension and running a fair amount of logging to troubleshoot a couple of issues I ended up getting an email from CloudOps about why there were all these warnings appearing for the tenant I was working in (I’m pleased I wasn’t using error logging :-)).

The lesson here was, be sensible with the logging – when tracing you are better off logging at an info level, and be very conscious that if you use warning or error levels a lot then you will probably end up in a discussion with the cloud team.

Triggers

Some programs in M3 have extension points which allow for you to override specific methods in M3, this could be so you can add your own custom logic on returning a value. One of the key things about triggers is that they have to be exposed to the framework by M3. At the moment, if you don’t have an exit point in a program, you can request one gets added.

You can see the extension points on a specific program by looking in Metadata Publisher – there is a section called “Extension Points”. Taking a look at PPS912 we can see that there are extension points that allow us to trigger off calls to get the Purchase Price, the Purchase Quantity, Status Supplier and several other functions.

There are some considerations (this is not an exhaustive list by any stretch) when using these extension points that I came across that gave me some odd results when I was iteratively working through some XtendM3 developments

Getting the Code Signed

There’s a link below with the approval requirements. There’ s a few hints to make the process a little smoother

Useful Links

XtendM3 Webinar
https://pages.infor.com/20191112-oth-edu-webinar-m3-extensibility-modifications-in-m3-cloud-edition.html

XtendM3 Documentation
https://infor-cloud.github.io/xtendm3/

XtendM3 SDK – clone this to build your dev environment
https://github.com/infor-cloud/xtendm3-sdk-java

XtendM3 Sample Repository
https://github.com/infor-cloud/acme-corp-extensions

XtendM3 Approval Requirements
https://infor-cloud.github.io/xtendm3/docs/documentation/approval-requirements/