Adding some information into Posted Sales Invoice

Hi guys,

This is very tricky for me.

There are some infomation (such as L/C #, Seal #, Vessel #, Container # and etc) that we received after the invoices were created and sended to the customers. We invoiced the customer in advance before the items are shipped.

For tracking purposes, those information needs to be recorded in the system and displayed into these invoices (for custom clearance). Due to permissions issue; we can’t modify whatever that have been posted.

What is the best way to solve this problem?


ZEN [:D]

You can edit and add comments to a posted invoice, just add your info there and change your posted invoice report to also print the comment lines in it’s own section. The comments are in table 44 - Sales comment line, add a section to the report.


FYI. As customer’s requested the layout differently, then, we are using different invoice report for this particular customer. In this case, how do I link the comments to this new report?

Since there are several Users in charge on this; how do I setup the permission for each User to do not touch the comment lines that are entered by other Users.


I believe you could change the security premission on the sales comment line table to allow read and insert premission for the users, but not modify or delete, this would let them see and create comments but not edit or delete them, this would be the way to do it without any program changes, You could give a selected user edit and delete permissions so that someone could still make changes, just not all users

I am not a programmer so I will leave the method of doing this in code to others., but the basic principle would be to add a field to the sales comment table = userid, and then have code that checked user id and only let the user who created the comment to be the only one who could edit it.

Check Form 130:“Posted Sales Shipment”. There are some fields you can change on it. You should use the same trick. So:
-putting some new field on it and enabling them (standard they are enabled).
-Put some code in “Form - OnModifyRecord() : Boolean” (check F130 for more details)
-create a new codeunit like C391:“Shipment Header - Edit” but for the posted invoice.

If you have table designer, I would set up a new table (with new form) linked by invoice number in to which you can create a link from the Posted invoice. Simple and not too much trouble to upgrade.

Do you have a developer’s license?

If you do not, then you cannot create the necessary code to update a field in a “posted” table and set the proper permissions.

In that case you will have to create an additional table to add your values. This would not be that difficult to do.

No, we don’t have the license. That’s why I am trying to find another solutions.

John, do you remember about your responsed on “Printing 3 reports (Invoice, B/L and Packing List) at a time” ? This is the continuation of that subject.

Please advise about your idea.


I would think to use Sales Comment Line and added the information as many as needed and displays the information in the report. My problem on this is how to link the Sales Comment Line that entered in Sales Posted Invoice form into those 3 reports and placing those comments into specific area in the report.

Thanks for any helps.


Yes, I remember the previous issue.

I agree with kdm that you should create a new table to hold this additional informtion.

Are the new fields to be associated with the invoice header or the invoice line?

By the way I am assuming these fields will only be populated after posting. If they are too be entered for any reason prior to posting, then we need to re-think the approach.

based upon your answer to the above you should create a table with the primary key the same as the table ssociated above.

For the Invoice Header it would be No. or the sales line No.,Line No.
add the fields to this table you want.

Create a form to enter/show the fields for this new table, dont show the key fields.

Add a menu item or button on the sales invoice header form to press that launches the form and pass the key values to the form.

On the report/documents you will need to set a global for the new table and call the record to popuate it on the form.

I think that is it, or a starting point. Let me know if i can help, or if you want to try a different direction.

Still not sure why you don’t just use the existing sales comment line table,

add to your report data item

Sales comment line table, indented one level from the posted sales header linked by No.

then you can make a section on your report with the sales comments.

just an idea

That certainly is a way to do it, but then it depends on whether you want to be able to seperate the information. In a coment you have no ability to manage the input, insure that it is entered. It really all depends on what is trying to be achieved. By far the easiest way is to enter comments then just bulk drop them on the report. I read into it bit more than that.

In version 4.0 the sales comment table has the following fields already, they just don’t show on the standard input form, but they are there.

Enabled Field No. Field Name Data Type Length Description
Yes 10000 Print On Quote Boolean
Yes 10001 Print On Pick Ticket Boolean
Yes 10002 Print On Order Confirmation Boolean
Yes 10003 Print On Shipment Boolean
Yes 10004 Print On Invoice Boolean
Yes 10005 Print On Credit Memo Boolean
Yes 10006 Print On Return Authorization Boolean
Yes 10007 Print On Return Receipt Boolean

And the report 10074 - Sales invoice already has the sale comment line code in it, so that if the check box - print on invoice is yes then the comment prints. There is actualy no modification needed, except to show the check box on the sales comment input form. I think it would be easier overall to use this built in information and make an organizational change so that the company changed they way they did the entry, and let Navision be used un-modified if possible.

I agree with you completely, that he is asking for more then just this, but what I am trying to do in my own small way is try to get users to modify their business practices first to fit Navision before they modify Navision to fit a business practice, in most cases existing business practices where created to fit the last peice of software they used to manager their company anyways,because that software package couldn’t easily be modified, so they made there business fit the program. Then people switch to Navision because the salesperson tells them they can easily change it and make it look just like their old program. Then when they want to upgrade or apply a service pack they can’t without great expense. We just went through an upgrade from 2.0 to 4.0, and in the process got rid of a lot of customizations, but not all, now we would like to apply SP1 or SP2, but just to get a quote to upgrade from 4.0 to SP2 our NSC wants $1200 to provide only the quote, the $1200 doesn’t apply to actually applying SP2. the best guess on the whole upgrade is around $10000, I can only imagine what going to Nav 5.0 with cost.

Your point is very well taken! I also agree that the user must take great care in how they fill a gap. You raise many good points and they have been discussed many times. I am not sure that I want to fill up Zen’s thread on this subject. But (and this is for humor) if you are going to spend $10 grand on uprade I will do it for $9. The point is you must have a huge number of modifications if that is the cost. Second I think you should look for an new partner. Upgrading to just a patch release (SP1/SP2) should not cost anywhere close to that amount. There really are two types of modifications at least thats the way that I look at it, 1-those that are intrusive to the code or the way the software “thinks” (these should be avoided almost always) and 2- those that are not. The suggestion to add a table and a form is very un-intrusive and would easily flow up to a new release. That being said, we have only seen a bit of NAV 5.0 and NAV 6.0 and we really ( I think) can’t imagine what the upgrade path will be to them.

Hopefuly we have not scared you ZEN!!

Thank you for replying. I read the idea carefully; to make sure I am not getting confused…[:)].

FYI. The additional fields are need to be entered after the invoices were posted; on both tables Sales Invoice Header and Line.

I will try to create the tables and follow the direction. Hopefully I can do it.

John, please explain more detail on this:


Add a menu item or button on the sales invoice header form to press that launches the form and pass the key values to the form.


P.S. That’s pretty scary…[:#]

Quick question, do you have the application designer license ? if not you can not access cal/code in forms and wont be able to make this button code.

I do have the license.



To call your form for the sales invoice header information you need to go into the form design (form 132). Right click on the Invoice button (left bottom) select Menu Items.

Add an new line in the menu call it what you want (Add Shipment Info) the action is runobject and the run object is FORM 5xxxxx ( the new form you created).

Next CLick on the properties button for that menu item and enter “RunFormLink” No.=FIELD(No.)

This will pass the sales invoice no. to your form and create the new record. Remember your new table primary key must be No.

Compile the object.


I am thanking you so very much. You are excellent and a great teacher!!! [Y] [Y] [Y].


ZEN [<:o)]

Zen, why don’t you just get your NSC to add the new fields, and modify the codeunit. Its a very minor mod (less then 30 minutes work), so it can’t cost a lot.

I did this once for a client that needed to track the vessel and other tracking infomation related to the container that goods arrived in, so I am guessing somehting the same as what you need. If you create a new table, and new forms etc, its just going to be on going work. And adding new fields is not going to add very much to the cost of an upgrade.

Also you can add the fields to the Sales Header as well, making life much easier.