StrataFrame Forum

Invalid Operation Exception

http://forum.strataframe.net/Topic4760.aspx

By Larry Caylor - 11/24/2006

I have a business object (CustomerBO) that I’ve configured to raise a single property changed event for all properties. I’ve placed this BO on a SF maintenance form. The maintenance form also includes a ChildFormDialog that maps CustomerBO to the dialog form. If I add the FieldPropertyChanged event handler to the maintenance form code, I get an invalid operation exception (see attached) when I attempt to show the ChildFormDialog. If the FieldPropertyChanged event handler is not present on the maintenance form, the ChildFormDialog executes okay.  The FieldPropertyChanged event handler doesn’t have to contain any code to cause the error.

-Larry

By StrataFrame Team - 11/27/2006

Gotcha... I'll see if I can reproduce it on this end... shouldn't be too hard.
By StrataFrame Team - 11/27/2006

I was certainly able to reproduce this one... I fixed it by creating a secondary collection of the keys for the dictionary that I was iterating over.  I'm building an update right now and I'll post it here so you can give it a try.
By StrataFrame Team - 11/27/2006

OK, I only posted the source code to the MyAccount area because the full install is currently undergoing some revisions.  So, if you need the full blown install, you'll have to wait for the next update.  I also posted the DLLs here so you can just dump them out to the GAC and the common files folder if you want.
By Larry Caylor - 11/27/2006

I downloaded and re-compiled the updated source and problem solvedSmile. Thanks for the quick fix. I’m glad you were able to reproduce this one. I still haven’t been able to get the database connection wizard to work without causing an application exception. Since you can’t reproduce it I’m feeling that I must have missed something in setting up security but can’t figure out what.

-Larry

By StrataFrame Team - 11/27/2006

Yeah, I'm glad we got this one fixed as well.  As for the other problem... it might be some sort of PInvoke problem.  It looks from your samples that the C# MDAs are catching the exception while the VB.NET ones aren't, so I'm going to see if I can reproduce it in C#.  I'll keep you posted.
By Larry Caylor - 12/17/2006

It looks like a new bug managed to slip into the 11/27/2006 source code. The problem does not appear when the same program code is run on the 11/20/2006 release version of the framework. The exception is raised when a user ID that does not exist in the security database is entered on the login screen (I'm using the standard SF login screen).  If you continue after the exception is raised, a security event ID: Error message is displayed and if a valid user ID is entered, the login succeeds.  

 

Here is the exception detail and a screenshot is attached.

 

MicroFour.StrataFrame.Business.BusinessLayerException was unhandled by user code
  Message="The CurrentRow could not be evaluated because the CurrentRowIndex is out of range.  Business object record count: 0.  CurrentRowIndex: -1."
  Source="MicroFour StrataFrame Business"
  StackTrace:
       at MicroFour.StrataFrame.Business.BusinessLayer.get_CurrentRow()
       at MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO.CreateInternalData()
       at MicroFour.StrataFrame.Security.BusinessObjects.SFSUsersBO.IsDataValid()
 

By Larry Caylor - 12/17/2006

BlushPlease disregard the previous post. I found the source of the problem. I failed to recompile ALL of the SF projects when I installed from the source.

-Larry

By Trent L. Taylor - 12/17/2006

Good to know.  I was a little confused Smile
By Larry Caylor - 12/18/2006

Some days I'm more than a little confusedWink
By Trent L. Taylor - 12/18/2006

Yup...me too BigGrin