Intermittent gap in custom Number Maintenance sequence on alm_license
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi Community,
I configured Number Maintenance for Software Entitlement [alm_license]:
- Prefix: SWL
- Digits: 8
- Field: u_number
- Default value: javascript:global.getNextObjNumberPadded();
A Before Insert/Update Business Rule copies u_number to asset_tag.
In TEST, I’m intermittently seeing a skipped number, for example:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @pavan Punna ,
Skipped numbers are expected behavior and are almost always caused by how the sys_number_counter allocates numbers. Because your u_number field uses javascript:global.getNextObjNumberPadded(); as its default value, the number is fetched and permanently consumed the exact moment a new record is initialized. Even if you did not cancel a form or experience an error, the missing number (SWL00008916) was consumed by the system and cannot be rolled back.
To strictly enforce sequential numbering without gaps on your custom configuration, you must change when the number is generated:
- Remove the Default Value: Clear javascript:global.getNextObjNumberPadded(); from the Dictionary entry's Default Value tab for u_number. This stops the number from generating when the form opens.
- Update Your Business Rule: Move the number generation logic to your existing Before Insert Business Rule.javascriptCopy Code
// Inside your Before Insert Business Rule if (current.u_number.nil()) { current.u_number = global.getNextObjNumberPadded(); } // Continue with your existing logic to copy to asset_tag current.asset_tag = current.u_number;
By doing this, the number is only pulled from the counter at the exact moment the record is successfully committed to the database, eliminating gaps caused by form loads or abandoned sessions. (Note: The u_number field will appear empty to the user while filling out the "New" form).
Please mark the Solution Accepted if the above helps. This will help others.
Thank you
Vijay