extract data before commit

ara3n
Member Posts: 9,258
Hello
I'm looking for ideas on how extract the glentries that get posted to fix inconsistency issue. Normaly I use
I've tried to dump the data to file, but navisioni errors because the file get's locked out. So you have to create new file. (not helpfull);
You could use automation. shell command?
I'm looking for ideas on how extract the glentries that get posted to fix inconsistency issue. Normaly I use
message(GLEntry."G/L Account No." + ' ' + GLEntry."Amount");
I've tried to dump the data to file, but navisioni errors because the file get's locked out. So you have to create new file. (not helpfull);
You could use automation. shell command?
0
Answers
-
ara3n wrote:Hello
I'm looking for ideas on how extract the glentries that get posted to fix inconsistency issue. Normaly I usemessage(GLEntry."G/L Account No." + ' ' + GLEntry."Amount");
I've tried to dump the data to file, but navisioni errors because the file get's locked out. So you have to create new file. (not helpfull);
You could use automation. shell command?
why don't you make a table (if you have permissions for that) and than enter values into that table rather then into the file?
I had similar problem and new table helped.0 -
well if I insert the data into a table, the consistency error will pop up and everything will be rolled back. I want to dump the gl entries to some place.0
-
ara3n wrote:well if I insert the data into a table, the consistency error will pop up and everything will be rolled back. I want to dump the gl entries to some place.
Indeed. My mistake.
What about small code that inserts into SQL through ActiveX ADO?
That should work if you properly open and close connectiong each g/l line.0 -
Yes that could work, but I don't think it's practical. When you are at client site , you have to create a new table, you have make sure they have the automation. change the connection string. to connect to the db.
Looking for something more simply and practical.
Any ideas are welcome.0 -
I don't see any other solution than create a new file, with a timestamp in the filename or something.0
-
In case you are working on SQL, put a CONFIRM just before the error. Let Navision stop there, open a new session and you can see the data written.
(But something lets me think you aren't working on SQL... so I would go with the solution of Denster)Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
AFAIK, Codeunit "417 Start Company Notes" in 3.6 Nav is always loaded...
So, you could make new function in this codeunit (actually, few of them) open file in that function, than in codeunit 12, you send whole record to 417 function that will write to file.
You will have to adjust Codeunit 1 cause you want to ensure that file is opened (on Navision Login) and closed (on Navision Logout).
I don't know what are prerequisits for use of codeunit 417 and, note that i'm talking of Navision 3.60... Not sure will it work on 4.x0 -
I will try the single instance codeunit. Good Idea. =D>0
-
Hello Wanted to Give an update on this. Used single instance and it worked.
Here is my code.
New Codeunit 50090 Single Instance. Insert is a new function.OnRun() IF TempGLEntry.FIND('-') THEN FORM.RUN(0,TempGLEntry); Insert(LGLEntry : Record "G/L Entry") TempGLEntry := LGLEntry; TempGLEntry.INSERT;
in codeunit 12 in finishcodeunit function added the following code..... GLEntry.INSERT; //S001 start cu50090.Insert(GLEntry); //S001 End
After posting the order and get the inconsistency error.
Run codeunit 50090 and you'll see all the GL Entries.0 -
-
what kind of possibilities?0
-
I checked a code a little bit (for another reasons that I wrote in posting prediction thread).
I tested it with breaking of transaction in posting procedure and, my test data is still in temp table.
Is this mean that temporary records are not rolled back on transaction break?0 -
I think I've answered your question in the other thread.0
-
No problem.0
-
Hi,
I'm trying to get this single instance codeunit to work for me, but I seem to keep getting a duplicate entry error. It seems the codeunit tries to write to the G/L Entry table. I am still a little weak on my programming but I thought the single instance codeunit saved the entries to a temp table and not the actual g/l table.
Hoping someone can tell me what I have overlooked. ](*,)
Dneal0 -
Did you set the tempglentry variable to to temp?
Also are you deleting the entry no once the form is closed?0 -
Hi ara3n,
I didn't set the tempglentry variable to temp, once I did everything worked superb! I have to admit that was a new property for me. Thank you so much for your idea and your help, it is greatly appreciated!
Dneal0 -
You are welcome. I allways double check variable that temp records. Otherwise big booboo0
-
Hi
Can some one suggest me on how to clear the temporary records inserted for G/L entry using the SingleInstance codeunit.
This case is for,
I have run the SingleInstance Codeunit once to analyse the Inconsistency and now I am able to reslove the problem. Again for another transaction, I am facing the same inconsistency problem. But when I run the codeunit, it still shows the old records which got inserted for first transaction.
Now I need to clear these records and would like to know the entries for second transaction.
Please suggest. Thanks in advance to all.Dilip
Falling down is not a defeat..defeat is when you refuse to get up.0 -
You need to create a function in the singleinstance codeunit that deletes the records in the temptable.
And before you run the whole thing, you need to call that new function.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Create a new function in Single Instance codeunit called. DeleteTempGLEntries.
In this function delete Tempory entries.
Add a buttom somewhere and call this function.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions