Awesome @dr_dan - thank you! My BPM now looks like this:
with this as the expression in Set Field:
callContextBpmData.Character01 == "PT" ?
new Ice.Lib.NextValue(Db).GetNextSequence("ST_PT_NumSeq").ToString("PT00000") :
callContextBpmData.Character01 == "RM" ? new Ice.Lib.NextValue(Db).GetNextSequence("ST_RM_NumSeq").ToString("RM00000") :
callContextBpmData.Character01 == "CM" ? new Ice.Lib.NextValue(Db).GetNextSequence("ST_CM_NumSeq").ToString("CM00000") :
callContextBpmData.Character01 == "MFG" ? new Ice.Lib.NextValue(Db).GetNextSequence("ST_MFG_NumSeq").ToString("MFG00000") :
callContextBpmData.Character01 == "CAT" ? "Enter Catalog Number" : ""
The last line is because we have a whole different nomenclature for our ‘Catalog’ items and those will just get typed in directly.
As far as looking up the next number, each of those sequences (“ST_PT_NumSeq”, “ST_RM_NumSeq”, etc.) get created in the Ice.SysSequence table the first time they are called via GetNextSequence.
This is in my test DB:
Is that what you were looking for with your question?
Side Note:
I tried to use SetSequenceCurrentValue from this post but couldn’t get the syntax correct:
We are on-premises and I have access to SQL so I committed the mortal sin of manually changing the “CurrentValue” field for each of those Sequences in SQL to match our last used part number, so that the next new one would be incremented by 1.
This is literally the one time I felt fairly comfortable changing something in the DB directly since it did not exist until I created it, and nothing else SHOULD care about that one specific value.