g/l entry consistent function
milind
Member Posts: 130
can anybody tell me the use of g/lentry.consistent in gen.journal post line codeunit and how it calculates balanceamount ,because while posting the purchase order I am getting an error about consistent function[/u]
0
Comments
-
This is the best error on earth that Navision can offer for you. Which db are you using a 3.7 DB or 4.0 DB? However I haven't came across anything like that in a 4.0 db but yes there are plenty of situations where 3.7 db throws the error.
Every posting that you make in Navision has to pass this Consistent function. It is present in the finish codeunit and generally checks on the amount and amount of the Balancing account of the respective posting, if both of them are not same then it throws the error.
It checks the balances based on calculations present in the trigger InsertGLEntry(CalcAddCurrResiduals : Boolean).Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
Thanks diptish
but is there any way to find exactly in which balancing account the amount diffrence is encountering .0 -
milind wrote:can anybody tell me the use of g/lentry.consistent in gen.journal post line codeunit and how it calculates balanceamount ,because while posting the purchase order I am getting an error about consistent function[/u]
Fromthe time you call the CONSISTENT function, till the next commit (or assumed commit), the total balance for the selected field must be zero.
You will only get this error if there is a bug in code.
The most common problems are:
Sales Tax bug in version 3.10.
Forgetting to round amounts posted to the G/L.
Adding a COMMIT in the middle of a posting routine.
Trying to post a one sided G/L entry.David Singleton0 -
Oh yes it is possible, you are posting a purchase order, so the codeunit that it uses to transfer the lines to the Journal is Codeunit 90. Do check this codeunit and it will reveal the mystery for you, do keep a track on the amount and you will get it.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
how we can identify total balance for the selected field must be zero.rgds
dhananjay0 -
Place a message box to display the values of the variables used in the Consistent function and it will display it. If you want more information then place another message box to print the value of the amount in the CU90.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
At the time of posting of purchase invoice this erroe will occur.
We have gone through purchase codeunit also, but not able to find out exact error.
Plz sugges solution .rgds
dhananjay0 -
Tell me one thing, during the psoting are you able to see the Posting lines dialog box? Is the error comming when posting the last line called Posting Balance Acc.? Or is it before the dialog box opens for you. I am sure you cannot receive this message before the posting starts.
Place the message boxes and you will be able to reveal the mystery.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
we are facing the error at the time of posting the last line of the dialog box i.e. posting the balancing acc.
We had put message over there but it will not solve our purpose.
It show an error for balance amount 0 & balance amount1 .rgds
dhananjay0 -
You want to put a message box in a posting routine? :shock:diptish.naskar wrote:Place a message box to display the values of the variables used in the Consistent function and it will display it. If you want more information then place another message box to print the value of the amount in the CU90.0 -
The message was just an indicator to show by how much difference the error is happening. The balance variable should always displaythe 0 value else the error message pops up.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
You want to put a message box in a posting routine?
Just for the purpose of testing obviously the message box needs to be removed before the same is being delivered to the client.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
dhananjay wrote:how we can identify total balance for the selected field must be zero.
For debugging this is quite simple.
Make sure you are working on a test database, because you are about to destroy it.
Before GL starts posting, add:
Find all the places in code where CU 22 is called. and prior to this add the following.
NewGenJnlline.copy(GenJnlline);
NewGenJnlLine."Template := "some template name
NewGenJnlLine."Batch := "some batch name
NewGenJnlLine."line no := NewJnlLineNo + 10000;
newGenjnl.insert;
COMMIT;
Then post, after the error, you will be able to look at the journal and figure out the error.David Singleton0 -
hi diptesh,
I put the message in gen.journal post line before g/lentry.consistent funtion there I am not getting balance amount 0 but some random amount which is not associated with particular order.I am not able to trace from where that amount is coming0 -
I got the same error when i was doing customization in 3.70 for SHE Cess.
I did this in a test database
comment a function consistent in codeunit 12
post purchase order in a test database.
Check out what effect is going incorrect.
Then u will have to go through the codeunits for posting purchase order to find from where the wrong values are going.0 -
The easist place to check all the values is in my view during the finishcodeunit function within the repeat statement. All g/l entries go through there and it really is much easier than finding all the places from where you post.
If you are not an experienced developer, or have an experienced developer to guide you, please stay away from the posting routines. There is a lot of functionality combined with NAV theories that you dont want to mess up. At the very least get someone to explain the do's and dont's for you.0 -
hi diptesh,
I put the message in gen.journal post line before g/lentry.consistent funtion there I am not getting balance amount 0 but some random amount which is not associated with particular order.I am not able to trace from where that amount is coming
Hi Milind,
Obviously you will not get the balance is 0 because if it would have been 0 then you would not have received the BIG error message
How the values of the variables are derived is present in the InsertGLEntry(CalcAddCurrResiduals : Boolean) function. Here you can have a look at the calculation. The inconsistency function is however one of the most complex errors in Navision.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
diptish.naskar wrote:...Obviously you will not get the balance is 0 because if it would have been 0 then you would not have received the BIG error message
Hi Diptish, actually this is not correct.
The error message is generated at the time of the commit, NOT when the posting is made to the journal. So its very possible that an entry of ZERO can generate this error. In fact a zero value posting is actually THE MOST LIKELY source of the error. What it can possibly indicate is that say a debit has already happened for an amount of $25.00 but the Credit for the balancing $25.00 was mistakenly entered as zero, or not calculated, or some how deleted.
I am not sure why you just don't do what i said in my earlier post. That solution is by far the easiest way to debug this issue.David Singleton0 -
Hi Diptish, actually this is not correct.
The error message is generated at the time of the commit, NOT when the posting is made to the journal. So its very possible that an entry of ZERO can generate this error. In fact a zero value posting is actually THE MOST LIKELY source of the error. What it can possibly indicate is that say a debit has already happened for an amount of $25.00 but the Credit for the balancing $25.00 was mistakenly entered as zero, or not calculated, or some how deleted.
I am not sure why you just don't do what i said in my earlier post. That solution is by far the easiest way to debug this issue.
Hi David,
The consistent function in the CU12 isGLEntry.CONSISTENT( (BalanceCheckAmount = 0) AND (BalanceCheckAmount2 = 0) AND (BalanceCheckAddCurrAmount = 0) AND (BalanceCheckAddCurrAmount2 = 0));
as you can see it checks for the values with 0 only, the message boxes placed by before this function revelas that the value is not calculating to 0 and hence the error message is comming.
As milind said that he is getting the error message while posting a PO, i just hope that this PO is not of a 0 value. I am trying to use what you said in your earlier post for debugging and will update the forum on this later.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 117 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
- 333 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 991 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


