The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Modifying number maintenance

a_qulatein
Mega Contributor

1. What are the potential implications of changing the numbering system so that it display INCYYYYMMDD.0000 e.g. (INC20140925.0001)

2. Please advise how can this be technically achieved.

 

My thoughts are not to tamper with the OOTB functionality but to create a customer field. My concern is the maintenance of it. i.e.

- How would we handle user creating records are the same time.

- How do we reset the numbering and and how can we maintain this?

 

Please advise.

7 REPLIES 7

Thanks Harikrishnan,


Your solution is sound. Now how do I set up schedule to rest the number to zero?


Just write a schedule job, which runs daily at 00:00 and put in this code:-



var gr=new GlideRecord("sys_number");


gr.addQuery("prefix","INC"); //you can query sys_id here to be sure


gr.query();


if(gr.next()){


gr.number=0;


gr.update();


}



This should do it, just test it in demo before you implement it



Regards,


Hari


Subhajit1
Giga Guru

Hi Abdul,


I think Harikrishnan have given you the perfect way to solve your issue.


Just to clarify, the above should be a Before Insert BR.



Thanks,


Subhajit