How to increment a field number value using Business Rule instead of Number maintenance.

Sherine
Kilo Explorer

Hi All, 

I have a string field, number, which populate the value as "ABC001'. When a new record is created I want the number field to be incremented to 'ABC002'. 

Initially, I did use the number maintenance concept, but in some scenarios, the functionality is breaking.

Please advise on how to proceed. 

Thanks in advance. 

 

Regards,

Sherine

10 REPLIES 10

Mark Roethof
Tera Patron
Tera Patron

Hi there,

So the field is actually now a string field, which does NOT use autonumber, is that correct? If it does still use autonumber, this could conflict. Also be aware, if it does not use autonumber, you can't use the search directly on the number.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hello, 

The field right now is just a string field, where few records are uploaded through xml. Now for new records, I have to build the script. 

Regards,

Sherine 

Hi, 

If we are using the number maintenance, some of the sequences are getting missed. 

Regards,

Sherine 

 

Hi,

you need to use before insert BR on your table and get the latest record and increment the count by 1 and then set the value

this link has the solution

Autoincrement string field(custom)

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader