Display AUTOMATICALY date and hour on the invoice


I am a beginer in Navision.

I have Navision 3.60, and I want to ad automaticaly date and time on INVOICE, so it will be shown on invoie when its printed.

Can anyone help me please.


Use CURRENTDATETIME in text box. it will print based on the time set on system…

For more info


I create a new text box?

In witch field should i put CURRENTDATETIME?


In the properties of the textbox–> go to source expression -->put CURRENTDATETIME


thank you for your help. I just need one more help from you.

Now the user canot change the time and date, BUT I need the time and date to be UNCHANGEBLE on INVOICE on the moment the user RECORD the INOVOICE.


The user record an invoice today at 15:00. If i read the same invoice twomorow the time and date it will de the time&dat for twomorow.

I need that time&date to be UNCHANGEBLE, SO WHEN I READ A RECORDED INVOICE TWOMOROW it will be the time&date when it was recorded, not when its readed.

I hope you understaND MY CASE.


Then create a field in Sales Inv. header table and write := Curentdatetime; in oninsert trigger and use the same field in report…

HI Alin,

i thing you only make a text box on form and then give the source expression ‘currentdatetime’. now in your case you should make a new field in table and write := Currentdatetime; in oninsert trriger of table and change the source experssion of that textbox as . [:)]

Could you be more specific.

Thank you,


What part are you having trouble with?

Since you want to save the value of the TIME you need to create a field to store that value.

So you have to create a field. I say TIME because “Posting Date” already exists.

So it looks like you want to add a “Posting Time” field TYPE Time to the Sales Invoice Header table.

This will require coding and a developers license.

OnInsert() //Table 112
“Posting Time” := TIME;

Your orig question “so it will be shown on invoice when its printed.”

sounded like you wanted to show the date & time when the invoice was printed…Not posted.

So the solutions isn’t as easy as adding a textbox in the report with sourceexp=CURRENTDATETIME

And since it can only be posted once, I’m not sure what use the TIME actually gives you.

Hi Savatage

I want to put the date and time (ex.21.06.2013, 9:00 am) on the invoice when its printed, and that date and time (ex.21.06.2013, 9:00 am) on the invoice should be shown whenever that invoice its printed or viewed.



So you mean to say when it is printed not created?

  1. Create a field in Sales Invoice Header table (Ex: Printed Date with type DateTime)

  2. Go to Codeunit 315 - Sales Inv.-Printed


IF “No. Printed” = 1 THEN
“Printed Date” := CURRENTDATETIME;

“No. Printed” := “No. Printed” + 1;

I want that the date and time NOT to be changed by the employe.

When he record an invoice the date and time should be freezeed whenever that invoice is printed or shown.


HI Alin,

a straight question but when do you want to store this data (ex.21.06.2013, 9:00 am) in the record at the time of creating or at the time of printing…

this is the important point here… you can always show the data in the report when ever u want.

but when do you want to store the data in the table is the key here…

hope you got me… also your question is not so vivid… better make it clear and understandable for the experts to help you solve your problem.



a straight question but when do you want to store this data (ex.21.06.2013, 9:00 am) in the record at the time of creating or at the time of printing…

At the time of creating the invoice


Then try this solution. It will work…

Ok then on insert trigger of the table populate pintdate and print time in the report

print date := today;

printtime := time;

if you want date time together in one field then

printdate time := currentdatetime;

then in your report use it as just normal field.



Hi Alin,

Have you tried what Mohana Suggested ?

I suggest atleast try and give us feedback.

[:P] At the time of creating the invoice

Normally this would be a straight question but in this case I curious on when you think the invoice is created.
To me it’s created when it’s posted.
But you could mean the first time it’s printed.


Could you explain in more details?