5.1 Classic GetNextNumber

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
shalomsims
Posts: 38
Joined: March 16th, 2022, 1:04 pm
Contact:

5.1 Classic GetNextNumber

Unread post by shalomsims »

Ran into an issue while converting from 5.1 Classic to MVC with the GetNextNumber service.

I have a loop ForEachItem that iterates over a list of items and updates which items are in the cart.


ForEachItem Loop with child GetNextNumber service
ForEachItem Loop with child GetNextNumber service


The GetNextNumber service that was being called was throwing this error.


Primary Key Constraint Error
Primary Key Constraint Error
GetNextNumber Service incrementing on wrong next available PK for EC_Item_Usage
GetNextNumber Service incrementing on wrong next available PK for EC_Item_Usage

The PK contraint violation started on ITU-10011064 and every time I tried it again it would increment to the next number instead of the next available number. So, to fix it I went to the db and found the next available number myself and used that as the starting Value. Then I changed it back to the standard StartFrom 10010000.
Found and manually changed next available number
Found and manually changed next available number

That seems to have solved the issue but I am not sure why it happened.
word count: 152

Tags:
Post Reply