Did you tried to use the latest way for the Key1 field in UD101 table?? I get duplicate key value error, it does creates the Key1 value the first time but it does not do increament and gives me that error, i checked the SQL side as well, and i do not see that column being gen for that NextSeq Db…what am i missing??
@klincecum I have run into a glitch with this code since the 2024.1.10 upgrade. We are seeing duplicate record id’s for some users but not others. Having the users Clear Cache seems to stop the dups…not sure for how long. We are encouraging our users to clear cache frequently.
Any thoughts on how to prevent? I have this code in a Pre-Processing Method Directive on Ice.BO.UD100.Update
Thanks @josecgomez ! I am new to using Functions but was able to get GetNextSequence working between the link you shared and a CodaBears YouTube video. However, the GetNextSequence starts at 1 where I need to start with the UD100.Key1 value of the last record (e.g. 00000001394). I have been playing with the SetNextSequence but not having any luck. Any suggestions?
I am very new to using functions in BPMs. Do you have an example of what the BPM would look like using the SetNextSequence?
I assume I use a Method Directive - correct? I am currently assigning the sequential number using Ice.BO.UD100.Update. Do I do the SetNextSequence here or somewhere else? Do I create variables for the parameters?
Ok, all you need to do is go grab my function library, and use the resthelp, or swagger to run the function SetNextSequence to the value you want next, just once.
Every time you call GetNextSequence for that key, it will bring int back and you just need to add your leading zeros like before.
Thank You! This was a learning experience as I have never used resthelp or swagger but was able to find some documentation and figured it out. I had to add an API Key and Access Scope that included the SetNextSequence function before I could run the function in resthelp.
The leading zeros were required in the original custom code to get around an issue where after the sequence number 10 it kept assigning the number 10 to each subsequent row. I don’t believe the leading zeros are required with the GetNextSequence function or at least from what I am seeing.
One question…can I assume that the sequence returned in GetNextSequence only applies to the sequenceKey and not across the environment? I am using “UD100.Key1” as my sequenceKey so expecting the sequence I set to only apply to this table/field. Apologize if this is a silly question but this whole process has been new to me.