1function autoIncrementCustomId(lastRecordId){
2 let increasedNum = Number(lastRecordId.replace('ABC','')) + 1;
3 let kmsStr = lastRecordId.substr(0,3);
4 for(let i=0; i< 6 - increasedNum.toString().length; i++){
5 kmsStr = kmsStr+'0';
6 }
7 kmsStr = kmsStr + increasedNum.toString();
8 console.log(kmsStr);
9}
10
11autoIncrementCustomId('ABC009999')