Hi,
I've designed a new version of the Sales Order form and subform where the control should work as follows:
MainForm.SellToCust - TAB
SubForm.No - TAB
SubForm.Qty - TAB
SubForm.No - TAB
SubForm.Qty - F6 -> Create new Order returning focus to SellToCust
The problem I have is with the returning focus to SellToCust after creating the new order. Here's the code I'm using behind the F6 menu-button:
// Save Current Record
CurrForm.SAVERECORD;
COMMIT;
// Initialise New record
INIT;
"Document Type" := "Document Type"::Order;
"No." := '';
INSERT(TRUE);
COMMIT;
SETRANGE("No.");
IF xRec."Journey Code" <> '' THEN BEGIN
"Journey Code" := xRec."Journey Code";
MODIFY;
COMMIT;
END;
// CurrForm."Sell-to Customer No.".ACTIVATE;
If I put in the code commented out above (i.e. CurrForm."Sell-to Customer No.".ACTIVATE;), I get an message asking do I want to Rename the Record.
If I say Yes to this message I get a message saying I'm not allowed rename a Sales Header. If I say No, the new order is created but the Form stays on the previous order.
Leaving out this line of code results in the Form displaying the new Sales Header record but focus remains on Subform.Qty field.
Any ideas?
Thanks in advance,
Richie
Answers
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Any idea's?
Regards,
...
Everybody on-line.
...
Looking good!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
...
Everybody on-line.
...
Looking good!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!