How to get number on service portal

jonnyyan
Kilo Contributor

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

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Ujjawal Vishnoi
Mega Sage
Mega Sage

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


View solution in original post

5 REPLIES 5

Just to make sure we have string in data.num. Kind of Similar as toString() function.

Hope it helps.