cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi Friends,

My problem is this. My client is want automatic item code generation so how I can do this can you please suggest me.

0 Likes
View Entire Topic
Former Member
0 Likes

Hi Naveen.......

Try this and just replace the '?' by your alphabets before code number as per your requirement.....

declare @temp as char(15)
IF ($[OITM.ItemType]) = 'I'  And ($[OITM.ItmsGrpCod]) =100
	BEGIN
		set @temp=(select max(right(itemcode,6)) + 1 from oitm where 

(itemtype='I') and (len(itemcode)=11) and (left(itemcode,5)='?'))
		set @temp='?'+isnull(replicate(0,6-len(@temp)),'')+@temp
		select isnull(cast(@temp as char(15)),'?000001')
		
	END

Hope this will help you.......

Regards,

Rahul

jitin_chawla
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi,

Please check Note No. : 1378434 regarding the issue mentioned by you. The same explains the steps how to handle the issue.

Kind Regards,

Jitin

SAP Business One Forum Team