Copying F3 functionality.

Hello, On the Invoicecard I want to create a shortcut (under a Menu-button) which creates a new Invoice. This because the customer wants to create a new invoice even when the cursor is in the subform. (F3 is no option because it creates a new line). Referring to this topic ( I know how to do it. But the problem is that the customer doesn’t use Default Nos. but only Manual Nos. The code in the topic above only works with default numbering. Does anybody know how I can rewrite following code so that this functionality also works with manual nos? INIT; “Document Type” := “Document Type”::Invoice; “No.” := ‘’; INSERT(TRUE); Thanks.

Hi Thijs, you could use a dialog window to ask the user the new invoice no: define the variables: d, datatype Dialog InvoiceNo, Code, 20 d.OPEN(‘Invoice No. #1###########’); d.INPUT(1,InvoiceNo); d.CLOSE; INIT; “Document Type” := “Document Type”::Invoice; “No.” := InvoiceNo; INSERT(TRUE);

Would this work? Name DataType Subtype Length Script Automation ‘Windows Script Host Object Model’.WshShell IF ISCLEAR(Script) THEN CREATE(Script); Script.SendKeys(’{F3}’); Also see:

Thanks for your solutions. The only thing is that it is no option to use a dialog. This because the customer has to do another action, press . The reason why they want to create the shortcut for a new invoice is to decrease the actions with the keyboard. The option with the automation doesn’t work because I’ll get an errormessage: ‘Could not create an instance of the OLE control or Automation Server.’ Does anybody have another solution for this problem?

Why they don’t use mouse and press the arrows: Last and Next on the toolbar?

Hi Thijs! The Primary-Key Fields of your “Invoice-Table” (Table 36 Sales Header) are “Document Type” and “No.”. So, for doing an INSERT you must have a Number! So how do you find these Numbers manually, are they depending on something? Regards, Jörg

What I mean is: I want the same functionality when you press F3 when the boolean “Default Nos.” = FALSE and “Manual Nos.” = TRUE in the No. Series Table. After pushing F3, the cursor goes to the “No.” field and you can type a number manually. With a shortcut I want to create this functionality even when the cursor is in de subform of the invoice. The problem with this customer is that they absoluty don’t want to use the mouse.

Try using CTRL+UpArrow on the keyboard to move to the header. Then press F3.

No offence guys - But Mr. Hizhusen is absolutely right.

Minimize keystrokes <—> Manual input of numbers??? If you make a Menu button with a Menu item ‘Insert new’ you can define the ShortCutKey as F3. This way you overrule the default F3 functionality and it can be used from the subform. What you want is: F3 - Activate No. - Input number - Enter To me that is the same number of actions as: F3 - Dialog box to input number - Enter - Activate field after No.