See this link for posting code.
Don't have time to modify/test for your data, but this is how I have accomplished this task for online data.
// example ID = 'LT00002'
if(isempty($feature.ID) && $feature.SYMBOL_TYPE == "2SL"){
var vals = FeatureSetByName($datastore,"Testing4Pro.DBO.StripingPoints",['ID'],false)
var LTvals = Filter(vals, "ID LIKE 'LT0%'")
var numarray = []
for (var n in LTvals){
var nn = Number(Replace(n.ID, 'LT',''))
Push(numarray, nn)
}
var maxnum = Max(numarray)
var maxtext = Concatenate('LT',(Text(maxnum + 1, '00000')))
return maxtext
}
First checks to see if the ID field is empty, and the correct feature type (I have multiple feature types in the same feature class with their own ID prefix).
Grabs the featureset with the ID field.
Filters to just the matching features (remember, this is for multiple feature types).
create an empty array
iterate through the filtered features, strip off the text prefix (in this case 'LT') and add to the array as a number.
now, find the max number in the array
concatenate the prefix back on with the max number incremented by one, and formated as text with 5 digits.
Done.
Hope this gives you an idea.
R_