We have a requirement to create item number automatically using item rule set
There is requirement to create item number automatically based on ATTRIBUTE VALUE and followed by sequence 0001.
Example: ATTRIBUTE VALUE - JA and Sequence - 0001 and item number will be "JA0001", "JA0002", "JA0003", "JA0004"......"JA0010", "JA0011".
but starting "000" zeros are getting defaulted.
Below is the item rule I used to create item number
Secondary If Expression - length("MFG") == 3
Return Value - [Item].[Test Style Attribute].[Category Code] + "0" + auto_sequence("MFG", 1, 1)
Secondary If Expression - length("MFG") == 2
Return Value - [Item].[Test Style Attribute].[Category Code] + "00" + auto_sequence("MFG", 1, 1)
Secondary If Expression - length("MFG") == 1
Return Value - [Item].[Test Style Attribute].[Category Code] + "000" + auto_sequence("MFG", 1, 1)