Page 1 of 1

Error when custom form closes

PostPosted: Thu Jan 24, 2019 6:25 pm
by SBarnes
Hi Mike,

We are getting the attached error when a custom built from that is based upon JiwaFinancials.Jiwa.JiwaApplication.ProcessAction.UserInterface closes.

Launching the debugger does not throw you to the exception in visual studio, so its not the plugin code that is at issue, do you have any ideas on how to resolve this?

Re: Error when custom form closes

PostPosted: Fri Jan 25, 2019 9:45 am
by Mike.Sheen
Hi Stuart,

When a form closes, we persist the position, dimensions and window state (maximized, restored, and so on) into the table SY_FormSettings so when it is re-opened it will be put back in the same size and position and state.

This table has a foreign key constraint to SY_Forms.ClassName - and so the error you are getting would indicate the form's class name does not match what is in SY_Forms. We use GetType.ToString() on the form to determine the class name - so compare that to the entry in SY_Forms to ensure they match.

I think this problem might happen if the class name was renamed in your code at some point after the entry was created in SY_Forms. Hard to know without getting some hands-on with the database + plugin.

Mike

Re: Error when custom form closes

PostPosted: Fri Jan 25, 2019 9:51 am
by SBarnes
Hi Mike,

The class has not been renamed, the server is in Azure do you want me to send you the login details as this would probably be quicker than sending you the plugin, by the way when it does it, you have to kill Jiwa with the task manager as it won't close the screen at all?

Re: Error when custom form closes

PostPosted: Fri Jan 25, 2019 11:32 am
by Mike.Sheen
SBarnes wrote:Hi Mike,

The class has not been renamed, the server is in Azure do you want me to send you the login details as this would probably be quicker than sending you the plugin, by the way when it does it, you have to kill Jiwa with the task manager as it won't close the screen at all?


Could provide a small plugin which reproduces the issue? For me to remote in and troubleshoot I'd have to bill for that time - plus it's always more efficient for me to debug in a local environment so if needed I can step through our source.

Re: Error when custom form closes

PostPosted: Fri Jan 25, 2019 1:17 pm
by SBarnes
Hi Mike,

perhaps we can go around the problem, is there a method that I can override to stop the saving of the settings given the code I have docks it on open anyway?

Re: Error when custom form closes  Topic is solved

PostPosted: Mon Jan 28, 2019 9:27 am
by SBarnes
Hi Mike,

I think I've sorted this out, there are two actual custom forms that interact with each other and the second hadn't been added into SY_Forms hence the error when it tried to close the form and the Jiwa code was trying to save the settings.

You can open the second form from a button on the first, obviously there isn't any code that checks for an entry in SY_Forms when a form is shown as most Jiwa based forms launch off the menus and you need an entry in SY_Forms to make this happen.