Q:

Looping In Microsoft Dynamics NAV

I have two tables (MetreR)and (Billing):
MReading
     date
     amount
     Billgen

Billing
  date
  amout
  Customer No

I want to insert a record from MetreR table to Billing, anytime data or a record hits the MetreR table. It must run always. I don't want to use a job queue. 
MetreR.RESET;
MetreR.SETFILTER(MetreR.Billgen,'%1',FALSE);
IF MetreR.FIND('-') THEN BEGIN
REPEAT

    Billing.INIT;
    Billing.ID:=MetreR."No.";
    Billing."Customer No.":=Customers."No.";
    Billing.Amount:=Billing.Consumption;

      MetreR.Billgen:=TRUE;

MetreR.MODIFY;
END;

UNTIL MetreR.NEXT=0;
END;

A:

Are you able to extend or modify the MetreR table? if so then you should add your code to OnInsert on that table.

