Change the description after Posting

Hi,

I have a quick question. Is it possible to change the description of a transaction after posting to the G/L?

Thank you!

PH

Yes :slight_smile:

The only way to do it is in code - but yes you can modify the texts without any problem: GLEntry.RESET; GLEntry.SETRANGE (“Source No.”, my-cust-no); GLEntry.SETRANGE (“Document No.”, my-doc-no); GLEntry.SETRANGE (“Document Type”, my-doc-type); IF GLEntry.FINDLAST() THEN BEGIN GLEntry.Description := ‘A new description’; GLEntry.MODIFY; END;

Hmm… it mangled my code, not sure how to format that. There’s no online help on how to do this. Ian

Its a bug on the forum. The wysiwig editor didn’t appear in my browser and now I can’t go back and modify it

use the Preview option above to see what it will look like before you post. [;)]

PH, think very carefully about this, and understand what you are doing. Changing posted entries is generally not allowed in most accounting rules. even if its just the text. Also I do NOT recommend the code form the last post, I was just fixing the formatting.

David, I posted using Opera and the toolbar did not appear. The preview option also did nothing. After posting I tried the edit button to type html directly but after editing the post button does nothing. So… I switched to IE and tried editing the post. I could edit but once again the post button had no effect.

What would you not recommend from the code I posted? I’m pretty new to NAV so I’d like to know if what I have done will cause problems.

I have just done something using some code similar to that I posted. I had a case where, when posting an invoice, the first bill had a date of today but the last bill could be a year in the future. (not sure if bill is the correct term in English. I’m referring to when you have an invoice with the payment being split into several deferred payments)

To help the people handling the billing my modification immediately changes the accounting entries to add a little text to the description.

Ian

Ah OK, I have never used Opera, so maybe its an issue with Opera. BTW its not a true WYSIWYG editor. Your best bet if you need somethign complex ist o edit in Word and then use the copy form word option. Anyway its not possibel to edit posts after 30 minutes or so. The reason is that if we allowed that, then spam bots come in and post inoculous posts, then come back a week later and replace them with porn links.

if you need to then the easiest is just what I did, hit reply and the QUOTE and edit the reply.

In reality you should never change posted entries. But there are exceptions. For example after an initial dataconversion you may ind some missing information that needs to be added. Or a new mod was not testedproperly,a dn existing data needs to be corrected. BUT these are one off routines to fix one off errors.

To do this on a regular basis is just wrong.

In your case you should be adding this text prior to posting, and then modify the posting routines to add this data as needed.

As far as I know there is no way of influencing the text which nav is going to place in the G/L entries - other than modifying the posting routines.

If you have an order and you post the order, codeunit80 writes straight to the posted invoice table and the GLEntry table. The ‘pattern’ of the entries in the GLEntry table don’t follow a template but are hard coded. So the text which appears in the description field is more or less hardcoded.

Given the train wreck which are the posting routines (one massive 4,5k lines routine without a hint of a comment) its not something I would have thought is a good idea or a fun experience.

Also, any patches which come along will overwrite the changes.

CU 80 never touches the GL Entry table. That is done in CU12.

Virtually every NAV implementation modifies CU80, so you are going to have to get your head around it at some time. Start by looking at CU12 and see how data from Table 81 gets to table 17.Then once you have tha worked out, look at CU80 and see how it populates Table81 from Tables 36/37. You will see that its not a lot of work to do what you want.

In fact before ver 3.00 it was different and it used to be a standard test I gave new developers, was to pass text from Sales lines on to G/L entries to see how well they understood Navision.

The posting description that gets set to the g/l entry is a field on the table header (Sales Header, Purchase Header). The posting description field on the header is pre-populated with something like ‘Order 123345’. You can expose this field to the Sales order form and allow users to enter their own description or you can change the underlying table code to create your own description during entry. This will then be your posting description that is posted to the g/l.

I can modify the descriptions it places in all the lines, but not in one…normal since its a single field. In this case the two payments will be separated by a year. 95% now 5% later - sort of a guarantee. The problem is that there are lots of these and what I did was to take the two lines

PostingDate Descr Amount PaymentDate
4-Jul-2008 ‘Invoice 123456’ 10000.00 5-Jul-2008
4-Jul-2008 ‘Invoice 123456’ 500.00 4-Jul-2009

and change them to

PostingDate Descr Amount PaymentDate
4-Jul-2008 ‘Invoice 123456’ 10000.00 5-Jul-2008
4-Jul-2008 ‘Invoice 123456 (Retention)’ 500.00 4-Jul-2009

As there will be hundreds of pending payments lines, its to distinguish retentions from other bills.