MIRequest.Record.ToLogString

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.

When I get an error from the APIs, I’ll output the what was passed in on the MIRequest via MIRequest.Record.ToLogString(), it will provide useful output like we see below

As you can see with the CUSEXTMI.ChgFieldValue it’s not providing much helpful information on which field it errored on, but I output the Record.ToLogString() I can see what data I passed to the APIs and in this instance it’s pretty obvious the bad value.

Very handy!

This entry was posted in Development, M3 / MoveX. Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s