Thursday, June 10, 2010

Forms not saving user layout changes

You may have come across some forms where users complained it wasn't saving the layout changes they were making. The problem is quite easy to fix if the link between the 2 forms is straightforward.

I've had to deal with this issue for a client and this is what it looked like:

A custom invoice history screen was created and it lists all the invoice lines for a customer. The invoice history screen is called from the invoice journal header form. A normal button with the call to the form in the click method was used.

void clicked()
{
FormRun fr;
Args args;
;
super();

args = new Args("CusInvoiceHistory");
args.parm(custInvoiceJour.OrderAccount);
fr = new FormRun(args);
fr.init();
fr.run();

fr.wait();
}

Although this will call the form, it will not save any user customization (Window size, column width, column order, etc.). The problem lies in the fact that no Menu Item is used. I quickly changed the Button to a MenuItemButton that points to my form, changed the init of my form to properly initialize my query and that did the trick. There is no reason a call to another form shouldn't be done with the use of a Display Menu Item (I can't think of any at the moment). It is the "standard" way of properly linking the forms together.

Have an exception to that rule? Let me know in the comments.

No comments: