Yeah I avoid those little "r"s in front of strings. Sorry. The 'r' actually stops \ from working. I missed that. People rely on raw strings when their strings are mangled with Windows backwards slashes, this is a misuse and generally a bad idea. The 'r' syntax is mostly useful when working with regular expressions. But I digress.
You don't want the "r" in front unless you really want raw string literals for a real reason.
This works, I tried it -- THANKS for reentering your code.
script_expression='//Assign initial FacilityID value to variable FID;\
var IdSeq = NextSequenceValue("heSeq1");\
var FID = "HE_" + text(Date(), "MMDDYYYY_") + IdSeq;\
//Test first sequence value\
if(IdSeq<=999999){\
return FID} \
else {IdSeq = NextSequenceValue("heSeq2");\
FID = "HE_" + text(Date(), "MMDDYYYY_") + IdSeq};\
//Test second sequence value if necessary;\
if(IdSeq<=999999){\
return FID}\
else {FID = "Update Attribute Rule";\
return FID};'
This works too and it's easier to type.
script_expression="""//Assign initial FacilityID value to variable FID;
var IdSeq = NextSequenceValue("heSeq1");
var FID = "HE_" + text(Date(), "MMDDYYYY_") + IdSeq;
//Test first sequence value
if(IdSeq<=999999){
return FID}
else {IdSeq = NextSequenceValue("heSeq2");
FID = "HE_" + text(Date(), "MMDDYYYY_") + IdSeq};
//Test second sequence value if necessary;
if(IdSeq<=999999){
return FID}
else {FID = "Update Attribute Rule";
return FID};"""
OH right, "Arcade"! I learned it and then immediately filed it under "A" between to "AML" and "Avenue". The code editor here does not support it! Ha. I bet that's on someone's todo list. I actually learned AML in 2017 to migrate some data then put it back in the dustbin of history.