There are many ways to extract data from the APIs in M3, but often you need information that isn’t provided via the native APIs or the native APIs purely don’t exist for the table you want to query.
But over the years there have been a number of ways that you can extract data natively from the APIs without expensive mods or using webservices. The methods to do this can seem a little convoluted and had some shortcomings where you can quickly run out of sort orders on popular tables in the older versions of M3, but by the nature of the native methods we enforce good practices of using indexes. I typically make a concerted effort to use these APIs rather than webservice calls as they tend to be quicker, and require less configuration outside of the M3BE.
We have 3 different ways I’m aware of to set up custom data extraction via the APIs and this post provides a rough and ready run through of them.
MNS185 – M3 Browse Definition. Open
CMS010 – M3 Information Browser Category. Open
Something that I don’t see talked about very often is the Event Based Alerts built in to M3, it’s a cheap, quick and easy way to notify people that something happened within M3.
We of-course have the options of using e-Collaborator or ION, but that feels a little heavy handed for a number of tasks.
This is a quick rough guide on how we can create a lightweight event that will notify us when the full description of an item changes.
Programs we will use:
CMS045 – M3 Event Subscription. Open
CMS047 – M3 Event Based Alerts. Open
CRS111 – M3 e-mail Address. Open
CRS427 – M3 Application Message E-mail Param. Open
CRS424 – M3 Settings – Application Messages
CRS420 – M3 Application Message. Open
MNS051 – M3 Subsystem Job. Open
Here’s a quick and easy script to simply move a control on the panel, it takes the control name and new positions as the arguments.
Microsoft has recently started rolling out the Windows 10 Anniversary Update – which is great, however it does cause an issue with Smart Office and JScripts.
Smart Office will download the .js from the server, it will go through some of the compile phases, however it doesn’t produce the final .dll which Smart Office attempts to load and generates an exception similar to this:
MForms.Render.RenderEngine.PostRender Failed to run scripts
System.IO.FileNotFoundException: Could not load file or assembly <path to .dll>
and of-course the script doesn’t run. If you are using precompiled .dlls directly, then they work without issue.
Infor released Smart Office hotfix 17 for 10.2.1 last week which looks like it has resolved the issue. Once applied Smart Office will show a version of 10.2.1.0.169.
A while ago I was looking at standardising some of the debugging information applications I wrote would output, and on a reasonably regular basis I’d want to verify data my code was passing to APIs, especially if there was an error on the call.
It was during the search that I came across the ToLogString() method on the MIRecord.
I’ve been working on a project recently where we create a relationship between records in MWS070 and other data without code. One of the key fields is the RGTM, the record time. If you look at RGTM in MWS070 then you’ll notice it is rather helpfully formatted to HH:mm, in the database however it is formatted as HHmmss – this creates a problem when we want to create that relationship.
This is really a post to illustrate that you can do some really funky stuff with virtual fields – very easily.
A wee while ago I posted about some monitoring scripts that I wrote which also provide trending – but I was pretty slack and never got around to posting them, here they are. 🙂
This is a little light on the details but it should at least provide people with some ideas on how to achieve some fairly comprehensive monitoring for free. There is a lot that can be done to automate the deployment of this – but it’s a project for another day and there is a lot in this post as it is.
Note, I’ve only used these scripts on M3 13.2 and 13.3
If you do intend to use these scripts and modify or enhance them, then I ask that you provide the enhancements so everyone can benefit. I’ll be looking at setting up a github page to make it easier.
We have a combination of Perl and Powershell scripts and for convenience I’ve created a Linux VM which has an ftp server, rrdtool and the Perl packages that the scripts use. SUSE provide some neat tools which allows you to build a JeOS low foot print Linux distro.
You can retrieve the VM from http://susestudio.com and search for M3 Monitoring
The default the username is root, the password is linux (something you should change when you install :-)), it’s also set up for DHCP, again something that you may want to change.
And then use the scripts from this post which I drop in the the /root directory.