After we upgraded to ArcGIS Pro version 3.3.1 we are no longer able to run the autoIncrement script to populate values in a field calculate. Attached is the error we're seeing where it is referencing a function was not found. Has anyone come across this issue?
rec=0
def autoIncrement():
global rec
pStart = 1
pInterval = 1
if (rec == 0):
rec = pStart
else:
rec += pInterval
return rec
If you ignore the error and hit Apply/OK, does it work correctly? It might be a validation defect for the expression rather than an actual error in the expression.
So the odd thing is I hit Apply/OK and it would give an error saying I need to correct whatever is wrong before the calc can take place (that part seemed to be new in 3.3.1 - I want to say in the past versions it would let you click Apply/OK). After a few times of doing that, I tried again and I was able to see it go through.
I believe it is trying to run a function named "WF-"=. which isn't defined and should be calling the autoIncrement function.
I think the FACILITYID = line should be autoIncrement() and the concatenation and zfill should be handled in the function/returns.
Not sure what version of Pro this is from, but in 3.1.3 it is SequentialNumber helper and the top line tells it what function to execute:
R_