I'm attempting to create the code unit that ara3n suggested but am not sure where/how some of this code can be put into the code unit (designer mode). Example: How or where do you enter the "TempGLEntry@1000000000 : TEMPORARY Record 17;" ??? I don't see a way to enter this in the designer.
I've seen other postings with code displayed in the way that ara3n has put it in his posting. How do you get a code unit to display all of the properties and code the way that has been posted here? Can this code be imported some how, as is?
Thanks,
You copy the text and paste it into a text file with a TXT extension, and then go to Object designer and import that file (option text file).
Yes I did. I still had the error. I then tried posting the invoice without selecting the shipment and invoice problem and that posted and it also adjusted the outstanding amount to match the amount including tax on the sales line.
Yes, this is a problem we've also encountered. The problem was with the rounding when posting a credit memo. We were able to fix it by applying the same ROUND function to the credit side.
Hi all,
I'm getting this error and i used this tip because i thought it was due to decimal amounts not balancing. But when i run the singleCU for the second time it shows form General Ledger Entries with no entries, the form is empty. I also tried other tips posting to a journal and all amounts balanced =0 in the journal. So in this case what can be the cause for this error? Please can someone direct me to tha source of this error?
I describe what i'm trying to achieve: post value from a document by creating journal lines,call codeunit 12 with journal line record etc.
Hi i copy the code from your post and paste into a txt file, save and import, compile, add code to codeunit 12 and compile. then run CU 50000 once and run my process, then run CU 50000 second time and it shows me the empty G/L Entry form. Thanks for your reply.
Hi, thanks for reply
I'm trying to implement a functionnality that create payslips for employees and when i post payslip, it create posted documents and also create ledger entries according to amounts on the payslip, and also employee entries.To achieve this i create journal line from information on payslip document then i call the runwithcheck function of genjnlpostline CU. this works fine except for sometimes when the amounts are decimal, it throws inconsistent error. so i've tried as much as possible to round the amounts before posting, 90% it posts fine but a few times i still get the problem described above ](*,) .
thanks a lot really very helpful....
before this i was so far to solve inconsistency even felt unsecure(technically) to go through on it now happy when it comes
to me. unfotunatly maximum guys not familiar with this post because of they are not in touch with this forum..
Frist of all I would thank Mr. aran for giving this wonderful tool.
Am getting the same error While posting the Purchase Invoice.After going through all the Replies posted here,
My understanding is "The problem is due to Rounding precesion of Decimal Amount". is my understanding is right .
kindly requesting you all clarify whether my understanding is right , if not kindly guide me.
Hi there. How did you rollback transaction of other tables in posting routine? I can manage to not to insert to G/L any data (just comment one line) but what with other tables? And the document? Did you changed the code looking for every INSERT statement in posting code and commented it? I know I could do it, but I am thinking of something more simple, like do ERROR('') at the end of whole proces (but this way I cannot keep data in temp table of codeunit). Could you leave some tips? Thanks in advance.
Anything you have inserted into your TempGLEntry in your single instance codeunit stays in there.
That is how in my example I'm showing the glentry after a consistency error, which is just like any other error.
I do not know how simply get proper result without analasing whole code. In my case, when I add an ERROR at the end of purch-post codeunit, the are lots of COMMIT before, which means I realy post the document with all dimensions created and so on. If I add an ERROR after the SingleCU.InsertGL I get only first entry created by the system (there are always minimum 2).
Is there a simple soultion or I need to insert a lot of IF statements during whole posting routine?
if you want to see all the GL accounts for PO that you are posting, you would add the error in CU 90 before the last commit. If there other commits in there, you need to by pass it.
Ahmed Rashed Amini
Independent Consultant/Developer
you can always run the debugger and breakpoint it at the place where it write the G/L Entries to the permanent file and look at the entries being created - typically it is either a rounding problem or a balancing entry that does not balance.
Comments
You copy the text and paste it into a text file with a TXT extension, and then go to Object designer and import that file (option text file).
This was so easy to implement and helped me find the issue very very quickly.
Thanks for sharing this code. =D> =D> =D>
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Yes, this is a problem we've also encountered. The problem was with the rounding when posting a credit memo. We were able to fix it by applying the same ROUND function to the credit side.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I'm getting this error and i used this tip because i thought it was due to decimal amounts not balancing. But when i run the singleCU for the second time it shows form General Ledger Entries with no entries, the form is empty. I also tried other tips posting to a journal and all amounts balanced =0 in the journal. So in this case what can be the cause for this error? Please can someone direct me to tha source of this error?
I describe what i'm trying to achieve: post value from a document by creating journal lines,call codeunit 12 with journal line record etc.
Did you copy and past the object into a text file and then import it? (make sure the CU doesn't already exists);
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I'm trying to implement a functionnality that create payslips for employees and when i post payslip, it create posted documents and also create ledger entries according to amounts on the payslip, and also employee entries.To achieve this i create journal line from information on payslip document then i call the runwithcheck function of genjnlpostline CU. this works fine except for sometimes when the amounts are decimal, it throws inconsistent error. so i've tried as much as possible to round the amounts before posting, 90% it posts fine but a few times i still get the problem described above ](*,) .
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
before this i was so far to solve inconsistency even felt unsecure(technically) to go through on it now happy when it comes
to me. unfotunatly maximum guys not familiar with this post because of they are not in touch with this forum..
Who are "maximum guys"?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The majority of my friends maximum are..........
Frist of all I would thank Mr. aran for giving this wonderful tool.
Am getting the same error While posting the Purchase Invoice.After going through all the Replies posted here,
My understanding is "The problem is due to Rounding precesion of Decimal Amount". is my understanding is right .
kindly requesting you all clarify whether my understanding is right , if not kindly guide me.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Nav, T-SQL.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I'm new at this so help me.
How i define variables in this code "SingleCU.InsertGL(GLEntry);"
SingleCU as codeunit right? and what about Insertgl?
Insertgl is a function in that code unit..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Now it says i dont have the permission to write in CU 12 :S
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Hi there. How did you rollback transaction of other tables in posting routine? I can manage to not to insert to G/L any data (just comment one line) but what with other tables? And the document? Did you changed the code looking for every INSERT statement in posting code and commented it? I know I could do it, but I am thinking of something more simple, like do ERROR('') at the end of whole proces (but this way I cannot keep data in temp table of codeunit). Could you leave some tips? Thanks in advance.
Anything you have inserted into your TempGLEntry in your single instance codeunit stays in there.
That is how in my example I'm showing the glentry after a consistency error, which is just like any other error.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I do not know how simply get proper result without analasing whole code. In my case, when I add an ERROR at the end of purch-post codeunit, the are lots of COMMIT before, which means I realy post the document with all dimensions created and so on. If I add an ERROR after the SingleCU.InsertGL I get only first entry created by the system (there are always minimum 2).
Is there a simple soultion or I need to insert a lot of IF statements during whole posting routine?
Ps. sorry for my english skills
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
could you give me an advice how to find the error.
Thanks
http://mibuso.com/blogs/davidmachanick/
Still works in NAV 2015, just need to change Form to Page and instead of FinishCodeunit() make changes in FinishPosting()