new record in a subform

in a mainform i have linked a subform for entering informations about the customer (informations about a call with the customer). For that the latest entry is shown in the subform. Now if the user wants to add a new entry he needs an empty from. I can provide this with pressing . But what do i need to code behind a button to get this result ? thanks in advance

Variable WSH, type Automation, subtype ‘Windows Script Host Object Model’.WshShell In the OnPush-trigger: CREATE(WSH) WSH.SendKeys(’{F3}’); CLEAR(WSH)

hmmm… i couldn’t find the type “automation”. But is there no other way ? No built-in-function in navision ? btw: if i could use a tabular form this was no problem. but in the card form… ?!..

If you don’t have the type “automation” then you are using Financials 1.3 or even something older… Hmmm, I don’t understand exactly what you want to do, and I guess a simple Rec.INIT won’t do the job or you wouldn’t have to ask for a solution. Please explain your problem with more detail.

Yes Alex, you’re right. A simple INIT doesn’t solve the problem (I#ve tried, but without success) As we are a telecom-company we have to doa lot with telephone-data (or simply call-data). If there is a question from a customer about the invoice i want our customer care to give the possibility to store some informations (who has called, what did they agree with the customer to pay the invoice and so on). For that i created a form which shows the invoice- and payment-data and the due and overdue amounts. The form is devided in a mainform and 4 subforms. One of the subform is the information about the customer, where always the last entry is shown when a customer is selected to give the college the opportunity to see what was agreed with the customer last. If the collegue wants to create a new entry i need to have a fresh, unfilled entry (just containing the customer number, his phone number, the due amount and the overdue amount). This is simply, if i press . But in my opinion it is easier for the collegues to press a button on the subform, which gives them a new, fres view in the subform. I’ve tried INIT FILTERGROUP(4); “customer number” := GETFILTER(“customer number”); “A-number” := GETFILTER(“A-number”); FILTERGROUP(0); INSERT(TRUE); but the new record wasn’t shown in the subform. A “CurrForm.UPDATE;” didn’t solve this. But if i press the correct new view is shown. Hence i simply want to put the preocess of pressing to a button (with code behind shown above). We’re using DE2.50. So the automation-type should be included. But i didn’t find it when i created the variable WSH !!!..

did you try with something like: newrec.INIT; Newrec.“Customer Number” := “customer Number”; Newrec.“A-number” := “A-number”; IF (NewRec.INSERT(TRUE)) THEN BEGIN Rec := NewRec; Rec.FIND; CurrForm.UPDATE; END;

thanks to all. Now it’s working. Don’t know why it didn’t work before, but the CurrForm.UPDATE perfomed a problem. After having deleted it it worked… But why didn’t it before !!!.. however, thanks to all