on 11-08-2017 6:39 AM
Hi Experts,
I already created one serial number for Item1 in Goods receipt ,now again I update the Item2 with Item1 serial number in serial number management screen. this time I need to block the Updation. It only allows the serial number which was not in osrn table
I need to block the duplicate serial in Serial Number Management Screen.
Actaully I wrote a Sptransaction already, But it is Not working
My Sptransaction here..
--Serial Number management Screen
IF @object_type In ('10000045') AND @transaction_type IN('A','U')
BEGIN
IF EXISTS (SELECT T0.INTRSERIAL FROM OSRI T0 INNER JOIN OSRN T1 ON T0.INTRSERIAL= T1.DISTNUMBER AND T0.SYSSERIAL=T1.SYSNUMBER WHERE T0.BaseType In('59','202') AND T1.ABSENTRY=@list_of_cols_val_tab_del )
BEGIN
SET @error = 10
SET @error_message =N'Serial Number Exists'
END
END
The above query is not working.please help me to solve this issue
Hi Manikandan,
By default in my SAP Business One is not allowed to repeat serial numbers, maybe this could be set up, but I unknown.
Maybe this validation could help you:
IF @object_type In ('10000045') AND @transaction_type IN('A','U')
BEGIN
IF (SELECT COUNT(DistNumber) FROM OSRN WHERE DistNumber = (SELECT DistNumber FROM OSRN WHERE AbsEntry = @list_of_cols_val_tab_del) AND ItemCode = (SELECT ItemCode FROM OSRN WHERE AbsEntry = @list_of_cols_val_tab_del)) > 1
BEGIN
SET @error = 10
SET @error_message =N'Serial Number Exists'
END
END
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Diego lother,
Thanks for the reply, I tried it But the above transaction query is not working.
When I update the Serial number for the selected item in Serial Number Management -update Screen, it allows the existing Serial Numbers for the updations
Note:Serial Number Management Update Screen. it allows the existing serial numbers for another Item But, i need to block the existing serial numbers
Hi Manikandan,
Now I got your situation, I understood before that item2 is a new piece of the same product of item1. But with your last comment I realized that you want avoid that diferents product (itemcodes) have the same serial number.
Then try this:
IF @object_type In ('10000045') AND @transaction_type IN('A','U')
BEGIN
IF (SELECT COUNT(DistNumber) FROM OSRN WHERE DistNumber = (SELECT DistNumber FROM OSRN WHERE AbsEntry = @list_of_cols_val_tab_del)) > 1
BEGIN
SET @error = 10
SET @error_message =N'Serial Number Exists'
END
END
Hope it helps.
Kind Regards,
Diego Lother
User | Count |
---|---|
102 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.