Dear Experts,
I have a requirement to loop an entire table ("User" table). For the same I just did a FIND('-') on the table record variable and put the record variable in the REPEAT - UNTIL NEXT = 0 structure. But the mentioned structure only accesses te first record of the table. May be since I am not using SETRANGE so the REPEAT - UNTIL NEXT = 0 is only accessing the first record.
Can you help me out with the issue?
Thanks a lot.
0
Answers
Thanks for replying.
My code is as follows:
User.RESET();
IF User.FIND('-') THEN BEGIN
REPEAT
GenJouBtch.RESET();
GenJouBtch.SETRANGE("Journal Template Name",'JOURNAL VO');
GenJouBtch.SETRANGE(User,User."User ID");
IF NOT GenJouBtch.FIND('-') THEN BEGIN
GenJouBtch.INIT();
GenJouBtch."Journal Template Name" := 'JOURNAL VO';
GenJouBtch.Name := User."User ID";
GenJouBtch.Description := FORMAT(User."User ID")+' '+FORMAT('Batch');
GenJouBtch."Bal. Account Type" := GenJouBtch."Bal. Account Type"::"G/L Account";
GenJouBtch."No. Series" := 'UJV/HO';
GenJouBtch."Posting No. Series" := 'JV/HO';
GenJouBtch."Copy VAT Setup to Jnl. Lines" := TRUE;
GenJouBtch."Allow VAT Difference" := FALSE;
GenJouBtch."Sub Type" := GenJouBtch."Sub Type"::"Journal Voucher";
GenJouBtch.User := User."User ID";
GenJouBtch."Template Type" := GenJouBtch."Template Type"::General;
GenJouBtch.Recurring := FALSE;
GenJouBtch.INSERT();
END;
UNTIL GenJouBtch.NEXT=0;
END;
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Thanks a lot mohana. =D>
I don't know what should I call myself. :oops: ](*,)
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Sorry for replying late, but many many thanks to you too MBerger =D> \:D/