Forcing an F3 (new record)

Hello everybody, I want two buttons on my Sales main form. 1) order → standard navision form and functionality 2) new order → a new record has to be created (just like F3) and a no Serie must be created so the user can immediately start filling in data. Anybody a solution Thx

Hi Steve, if I understand you correctly then the only problem is part 2)… simply add a new button and introduce the following code in the OnPush trigger of that button:


INIT;
"Document Type" := "Document Type"::Order;
"No." := '';
INSERT(TRUE);

that should do. Saludos Nils

Ok, i agree with that. But the button is on the Sales form. So a new record has to be created with a number serie and the form has to be runned and point to the noew record Thx

Now I got it… so it’s the following code that is necessary: SalesHead is a record variable T36 Salesorder is a form type variable, e.g. F42 (depending which form you want to open)


SalesHead.INIT;
SalesHead."Document Type" := SalesHead."Document Type"::Order;
SalesHead."No." := '';
SalesHead.INSERT(TRUE);
SalesOrder.SETRECORD(SalesHead);
SalesOrder.RUN;

Saludos Nils