How to add Prefix to Number Field

Shalini Priya1
Tera Contributor

Hello Everyone,

Can anyone suggest me how to achieve prefix to REQ for a single particular item?

Lets say i have a General Request and when i submit the request it should display me GREQ1234 instead REQ and if i have some software request it should display me SREQ1234 instead of REQ.

Appreciate Your Sincere Help!

Thanks In Advance.

5 REPLIES 5

Aric5
Mega Expert

So far as I know those will have to be custom table(s).   Rather than trying to customize requests I would highly recommend managing these with categories or a custom "request type" field.   See the wiki article below for more information.
Managing Record Numbering - ServiceNow Wiki



Please remember to mark helpful or correct if either or both.


Community Alums
Not applicable

If these requests are all in the same table, you cannot do this with the standard number maintenance and would need to do this with a Business Rule, but I would be very careful with this.


Some things to consider here:


  • What purpose would the different numbers serve? If it is simply to help distinguish, you likely have the field that identifies these items as General or Software that you could use for reporting, grouping, and assignment just as easily.
  • Is it possible for a request to change types? If so, then this could cause additional confusion. What if something that was thought to be a General request or is submitted as a General request really should be a Software request (or some other kind of request). Getting too specific with the numbers could cause more confusion than value.

Hi Ben ,


The purpose of requirement is mainly to specifically to distinguish the request with other requests with prefixes added so that it would easy for users to identify   .


Yes i;m planning to use business rule but could you please guide me on that :


Thanks


You could try something like the following:


Business rule


When: Before (insert)


Condition: item = item name or item_sys_id *You want to include this   to differentiate the items, otherwise, it'll apply to all the requests*


Script:


var number = current.number;


current.number = "R" + number;



This is a very simple way of doing it. But before you do this, try using a checkbox or drop down field somewhere in the form to tell between a General or Software request. It'll be much easier to report on and you won't be changing the nature of the numbering system of the table.





Yeny




*If this helped you, mark helpful or correct*