Hope someone can help with this....
I have set the Sales Order form and subform to be editable only when the order is open. To achieve this I call the following SETEDITABLE function
IF Status = Status::Open THEN BEGIN
CurrForm.EDITABLE := TRUE;
CurrForm.SalesLines.EDITABLE := TRUE;
END ELSE BEGIN
CurrForm.EDITABLE := FALSE;
CurrForm.SalesLines.EDITABLE := FALSE;
END;
I call it from
ONAFTERGETRECORD
ONOPENFORM
Code that releases the orders
Code that Re-opens released orders.
It works great.
BUT when a released order is on the form, pressing F3 to insert a new order has no effect.
How can I protect non-open orders from being changed, allow users to see these on the same form AND allow users to insert a new record when they happen to have a released record on display ?
NB I don't really want to have to set each field to editable and non editable. Also don't want to block it at the ONMODIFY trigger as this really too late.
Richard Hensby
Application Specialist
Infinity Solutions
0
Comments
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Another method (not quite "standard") would be to create a new menu-item on the main form which creates a new record in the table and the put the short-cut key F3 to that menu-item!
Tommy
Thanks Tommy, I like this.
What code do I need to put behind the menu-item to create a new record and display it on the form.
Application Specialist
Infinity Solutions
Maybe I am missing something, but reading your code it looks like you are stopping the used from making any amendments to the sales header and line forms ???
Standard attain (AKA MBS- Navision Edition) functionality stop this from happening anyway ??? If I remember right, the user gets an error message about the order not being open and no modifications can be made ????
Is this not the same end result ?
Application Specialist
Infinity Solutions
Behind it I have the code
CLEAR(rec);
rec.INIT;
This seems to mimic the F3 to insert new record logic.
Anyone see any problems with this code?
Regards
Application Specialist
Infinity Solutions
How do I assign F3 to a function?
Regards
Application Specialist
Infinity Solutions
You create a new menu-item. Put F3 on the item as a short-cut and then you put something like this on the "OnPush"-trigger of the menu-item:
That should do it.
Tommy