Business Engine Configuration Data – and CRS021 – Sorting Options

Sorting Orders in the M3BE Configuration Files


How many of you have been stuck in that situation where you have to manage exported CMS005, CMS010, CMS015 configurations and you’ve struck that situation where you get a failure on the import of your configuration file?

Given it’s a fairly slow process to import it can be incredibly frustrating when someone doesn’t tell you that there is a custom sorting option, the import process will fail. And you’ll either get a failed to import message, an indication that the sorting order check failed or some other vague message which doesn’t really provide the information you need to fix the issue (though it looked a little like there may be some logging information coming soon).

When you export from these programs, the configuration gets saved in to the Configuration directory on the CFT Agent. You can see these files in the Business Engine Files tool.

The files are .zip files, and of-course within the .zip file we have an xml file which instructs the Business Engine Configuration Data engine what to check, and what to delete and recreate

When you can’t import, you have to go diving in to the XML in the zip file to look for the sorting orders (on the plus side there didn’t used to be a check of the sorting orders, we at least have that not in the .xml)

Last week I had 30 or so of these files that I needed to import in to a new tenant and I was torn, do I write a program to parse the files and then push the files or do I just push my way through and hope for the best. Given time pressures, I figured that I should not muck around and do just like I’ve been doing for the last couple of years. Of-course that came back to bite me 🙂

So, queue this weekends little project…

The project started with goal of scanning the exported configuration file, parsing it and then looking for the sorting orders (under the check element). I wanted to output the table, the sorting order and the keys for the fields.

This is done by reading a file, or if supplied a directory it will scan the directory for files. It will then read each of the .zip files and extract each file in the .zip if a .xml to a .tmp file in the temp directory. It’ll use the .Net XmlDocument to read that extracted .xml and then it will search for the CheckSortOption element and extract the fields. We then output this to the console.

Nice and easy. It does include the standard sorting orders because one of the tenants I was importing in to (one of the older M3CE tenants) had some standard sorting orders that were missing fields. And of-course additional fields may well be added to sorting orders as the product evolves.

Now I’m not easily satisfied, okay, I’m just really lazy…I wanted to check the tenant to see if there were differences in the sorting order (not to check the order of the fields)…so that was Saturday afternoon…

The new iteration will list out the field variations on each sorting order in the file.

Of-course, that’s not really where the story ends, is it? For a truly slack person isn’t going to want to manually create the sorting orders. The great thing is that a few months ago the CRS021MI apis were added to allow us to create sorting orders!

So an option was added to create the sorting order in M3. It however will not activate the sorting order. I deliberately the activate the sorting order because this is an intensive task, and if there are several being created on a table I would far rather it be controlled by someone.

It’s a .Net Console application and as always, this is something that I hacked together, so it’s not something that I’ve tested to any great degree. And it was really to solve some headaches for me, hopefully it is useful…

It’s available on github and the application can be downloaded from the zip file, extracted and run directly.

Happy creating of sorting options… 🙂


This entry was posted in Development, IONAPI, M3CE, powertools. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s