Add line in General Journals

Hi all

Is there a codeunit that I can call by using a button in Sales Orders that automatically would enter a new line in General Journals?

If not, is there some code in c/al that can be triggered from a button that can accomplish it?

Regards, Brian

I mean “add an entry into an existing general ledger batch” not add a line.

And it doesn’t matter if I can do it by a codeunit, c/al or another way

Sorry for not being clear enough

Sure Brian, I think you have lots of options for creating a General Journal Entry from a Sales Order. In order to start building the line, you’ll first need to know what it is that you’re trying to accomplish. If you can give us a much better idea of what you’re trying to do, we’ll have a better chance of defining a solution.

Sounds great and thank you for your reply

What we are trying to accomplish is to transfer a bonus amount that we calculate in the sales order directly as an entry in the general journal.

We have created a button named ‘Calc Bonus’ that does a few calculations from the sales lines. This amount is displayed in a textbox named ‘BonusTotal’.

Now a days we then take the amount from ‘BonusTotal’ and manually type that into the general journal.

What would be nice is to have a second button called ‘Transfer Bonus to GJ’

Not all customers should have this bonus and the entry in the GJ is not always the same. Therefore we can not use the default bonus function in Navision.

I hope that I have been specific enough :slight_smile:

Hi again.

I figured it out “myself”

Actually I read this post on another site which showed some example code of inserting entries in the glj.

http://www.mibuso.com/forum/viewtopic.php?f=23&t=40522&p=198734