Auto Numbers with a date prefix

Job2
Giga Contributor

Hi,

 

We want to to auto-numbering on a certain table with a date prefix but I am a bit stuck...  

I can't find anyone who has posted this in the past on this community but I do know the solution exists...  

Any idea anyone?  

1 ACCEPTED SOLUTION

Job2
Giga Contributor

We used condition: When = OnDisplay


with the following script to add the date of today as a prefix:



var month = '', day='', year='';




var gdt =new GlideDateTime();


month = gdt.getMonth();


day=gdt.getDayOfMonth();


year=gdt.getYear();




var array='';


array=current.number.split('VLN');


current.number='VLN'+day+month+year+array[1];


//current.number = current.number + month;


View solution in original post

7 REPLIES 7

sachin_namjoshi
Kilo Patron
Kilo Patron

Below post has solution to your question



Number Maintenance - Auto-Numbering Records



Regards,


Sachin


That's the solution I tried... But no luck.


Tried it on our customized table, on the task table, ... Doesn't seem to be doing anything...


Can you please post screenshot of your business rule?



Regards,


Sachin