change date type to be code type?

how to change date type to be code type

so I want to generate document number like this

Today = 06/16/10

so i want the Document No. → DOC 06/16/10

what should i do to be done like this?


cant you change the date type in the table against the fields?

what do you mean by that you want your Doc no to be like DOC 06/16/10?

06/16/10 tis a date data type right!

sorry, i really cant understand your query.

I want to import data from csv using dataport

so I want to generate document no automatically…

document no should be → DOC 06/16/10

DOC is default

06/16/10 is date of today

in the csv file, I don’t input any document no

WWhat about:

Text := STRSUBSTNO(’%1 %2’,‘DOC’,TODAY);

Where TExt is a variable of data type Text.

The FORMAT command will change date to text.

gsPostingDate := FORMAT(“Posting Date”);

almost correct

but my document no field is code

not text

how to change to be code type

You must be joking… NAV will convert Text to Code… Just use

“Document No.” := STRSUBSTNO(’%1 %2’,‘DOC’,TODAY);

Okay… my mistake

the code is okay

thanks everyone :slight_smile: