GL Entry xxxx already Exists

Hi We have done a customization for Jobs- Job journals. Customization is posting of GL entries for each Job Journal Line.In one scenario we get the above error stated. i.e when i am tryin to post something like this 1. Resource 2. Account 3. Item (to be more precise when Item is the last line of the Job Journals.) If i use a CLEAR(GenPostLine)in one of the routines, then the posting is ok, but the problem is i will have one GL Register created for each of the Job Journal Lines. My requirement is posting of GL Entries with one GL register for all Job Journal Lines. Thanx MK

Hi MK You have more than on instance of the GenPostLine trying to post at the same time. The Next G/L Entry number is held in this codeunit. When it is first called it takes the last gl entry No and adds one. But after that it keeps adding one to the value held in the codeunit. When another instance is called it gets the last number on table and adds one, but you will soon use this number when you post another line in the first instance. You will proberbly find that Navision is calling it in an Itemjnlline or some thing simular. Paul Baxter

Hi Paul Thanks for the idea. Infact i found that, but how do i solve it. regards MK

Just rewrite your posting routine to post items first. Of course you will get 2 GL registers, same as sales posting or purchase postting