Showing all new generated records in a tabular-type form

Hello everybody,

I need some help on a problem with updating a tabular-type form:

With the following code in the OnPush-trigger of the menue item in a menue button of my tabular-type form I’m generating some new records:

StücklistenKomponente.SETRANGE(Stücklistenart,Stücklistenart::STL1);
StücklistenKomponente.SETRANGE(“Stücklistennr.”,“Stücklistennr.”);
IF StücklistenKomponente.FIND(’-’) THEN REPEAT
StücklistenKomponente2.COPY(StücklistenKomponente);
StücklistenKomponente2.Stücklistenart := 0;
StücklistenKomponente2.INSERT;
UNTIL StücklistenKomponente.NEXT = 0;
CurrForm.UPDATE;

When I click the menue item I can only see the last of the generated records. To see them all I have to scroll to the top or activate another form and then come back to my form again. But I’d like the form to update itself automatically. Can anybody help?

Hi,

You can insert IF FINDFIRST THEN; before CurrForm.UPDATE - then you will see all entries from the first one and first one will be selected.

Cheers,

Viktoras

Hi Viktoras,

thank you very much. You are great. I just added ‘if find(’-’) then;’ to my code and it works well. CurrForm.UPDATE is not necessary.