- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 03:15 AM
Hi Team,
we are rebuilding the form on customer page from service portal, could you tell me how to get number field, the getNextObjNumberPadded(); not work
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 04:37 AM
Hi Johny,
getNextObjNumberPadded function will not work here because there is no source table for this function. Alternatively, You can Glide on the required table and can use newRecord function to get the number like below.
var inc = new GlideRecord('incident');
inc.newRecord();
data.num=inc.number+'';
(My assumption is you have already created number maintenance for your table).
Hope this helps.
Regards,
Ujjawal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 03:24 AM
Hello Jonny,
Have you created an entry in -
System Definition - > Number Maintenance Module for that table i.e. Purchase Application
If not then configure there for Purchase Application Table.
Then it will work.
Refer this -
Managing Record Numbering - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 04:37 AM
Hi Johny,
getNextObjNumberPadded function will not work here because there is no source table for this function. Alternatively, You can Glide on the required table and can use newRecord function to get the number like below.
var inc = new GlideRecord('incident');
inc.newRecord();
data.num=inc.number+'';
(My assumption is you have already created number maintenance for your table).
Hope this helps.
Regards,
Ujjawal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2017 07:19 PM
Hi Ujjawal
thanks very much, it's work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2021 10:39 AM
Hi
Could you pls explain what is the use of +''; in the line data.num=inc.number+'';
Thanks,
Prajakta