MNS209 – Getting Data From IDM

When I first started working with M3CE it was still under controlled availability and there were a few irritations that myself and other consultants were having around printouts, especially given we were working with configurable XML and there were some potential gotchyas with outputs to IDM, especially in the early days of the deployments.

Trying to gather information for troubleshooting was a challenge (I’m aiming for a post on this subject in the near future). At that point we couldn’t do a MNS270 (well MNS270 didn’t exist then, but…) -> Related Options -> View wouldn’t display anything even if you had save turned on and the CFT Agent running.

We also only had a truncated error message in MNS209 and 9 times out of 10, we only had the useless portions of the error message before it was truncated (the field has been increased in length long since then).

In those early days I was quite interested in exploring H5 scripting, so I quickly hacked together two scripts over a couple of evenings. They would retrieve data from the special IDM document type MDS_DistributionJobs; the first would retrieve the complete error message and some other useful information, the second would retrieve either the XML or the raw json from IDM and drop them in to a textbox on the panel so you could inspect either for troubleshooting.

When M3 sends data to IDM, it is sent in a json payload, this payload used to contain a base64 encoded value of the XML generated by the M3BE (and later, it potentially could be the .csv data also base64 encoded). It would also have the distribution instructions.

There’s been a few things that have changed since then, but in general this is what happens. And though MNS209 shows more details in the error message, it can still be a little painful going backwards and forwards between M3 and IDM when troubleshooting.

As the scripts were hacked pretty quickly together, in part to explore the H5 scripting, they weren’t the most robust and they broke a few times and they were clunky. But in general, the scripts served a purpose and help me quickly spot issues, saving many many hours of troubleshooting.

Early in 2020, I had the notion of tidying the scripts up, but as it was being done in my spare time and things started to get extremely busy both from a work perspective and personally, it sat on the backburner.

Roll on 2021, out in a new country which is locked down with Covid, our plans for travelling around the country no longer viable and I have some free time whilst on holiday, I figured it was time to get this done…so I’ve created the first cut of the new script called MNS209_pt_IDMInfo.

The script gets added to MNS209/B (this is from the Output. Manage per File in MNS270)

Once you’ve added the script and refreshed MNS209/B you should have a new button called IDM Status. Select one of the MNS209 records and then click on the IDM status button.

The script will then call the /api/items/search API through the ION APIs looking for a current document associated with the GUID. If it doesn’t find a result, it will look search in both the archived and deleted states for the guid. If it finds it, it will read the JSON and use that JSON to retrieve the resource based on the PID in the JSON. The resource contains the data sent to IDM.

This will then be displayed on the panel. As it does retrieve the resource, be cautious as large files may take some time…to help make this a little easier for people to see, the resource is retrieved after we display our dialog.

Below is an example of the output. It will show the PID, the status of the output (this is inprogress because the printer it is being sent to doesn’t actually exist). It will also show some additional information about this specific GUID including the template search priorities (if applicable) and the specific search queries used for the priorities.

Then it will display information about the target outputs. In the case below, this output was destined to go to be Archived (Target Type: item), emailed (Target Type: email) and printed (Target Type: print). We then have some useful information about the target types along with a dump of the original json, the resource json and if applicable, the decoded resource data.

You can retrieve the script itself from github here: and retrieve the MNS209_pt_IDMInfo.js file.

Happy New Year and happy troubleshooting! 🙂

This entry was posted in IONAPI, M3CE, Troubleshooting. 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 )

Facebook photo

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

Connecting to %s