Problem wih COMMIT before opning the form Gen. Journal

Dear All,

I have heard that in order to open a form from a code I have o user the commit Function before I call the form. which its working.

The problem is that Iam importing 5 lines from an excel tabel in the Gen. Journal Form. At the end of the code I commit the code and I call the form.

Now the problem is when I commit It take only the last line from the excel!!!

If I use the code without COMMIT, and I run my code hen I open the form manually I can see all lines!

I know my problem is in the commit function and with calling the form, how can I just open the form without commiting?

My code:

COMMIT;
“Import Gen. Journal Line”.RESET;
“Import Gen. Journal Line”.SETFILTER(“Journal Template Name”,’%1’,JournalTemplateName);
“Import Gen. Journal Line”.SETFILTER(“Import Gen. Journal Line”.“Journal Batch Name”,’%1’,JournalBatchName);
FormGJ.SETTABLEVIEW(“Import Gen. Journal Line”);
FormGJ.RUNMODAL;

Hi,

Using COMMIT can be dangerous because the standard rollback action, when a error occurs, will not be available. [;)]

Hello Mohammed,

I’m not sure if it’s what you wanted,

but you could have set “Import Gen. Journal Line” record as temporary when inserting,

and then firing up the form with the temporary record.

Afterwards you could then perform a loop on your temporary table to perform an INSERT “for real”, that’s on the physical table and not in RAM