Home > Dynamics SL (Solomon) Technical Info > Debugging Dynamics SL Object Model code

Debugging Dynamics SL Object Model code

I have made this mistake multiple times and it just cost me about 2 hours of debugging time so I thought I’d post it here in hopes of saving someone some time in the future.

I got this error today in one of my automated import logs:

System.Runtime.InteropServices.COMException (0x80040005): Value does not fall within the expected range.

After spending a long time checking the value that I was trying to import against the control’s Mask property and other things like that, I remembered – the value that is not in the expected range is the control name.

The offending code is something like this:

sivApp.Controls[“xuser1”].Value = “ABC”

I was spending all of my time analyzing the “ABC” value, but that wasn’t the problem. It was the “xuser1” value. At some point, my customization had changed the control name from “xuser1” to “xduser1”, so the “expected range” was a valid control name and what I was passing in was not a valid control name.


  1. No comments yet.
  1. No trackbacks yet.

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 )

Google+ photo

You are commenting using your Google+ 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

%d bloggers like this: