cancel
Showing results for 
Search instead for 
Did you mean: 

Block the expired batch date

Former Member
0 Kudos

Hi expert,

I am going to block the expired date when i trying to update the existing batch.

If i input the existing batch number which the expiry date already expired the batch window should be blocked.

I use the SP_SBONotification.

My query is like this.

if @objtype= N'1000004'  
    
		BEGIN 
		
	
		If exists (SELECT distinct(OBTN.DistNumber )  FROM OBTN,IGN1,OBTQ where OBTN.AbsEntry = OBTQ.AbsEntry  and IGN1.itemcode = OBTN.ItemCode  and convert(varchar(10),OBTN.ExpDate,112) = convert(varchar(10),GETDATE(),112) and   OBTN.AbsEntry    =@docentry )
		begin
			SET @error = 10
			SET @error_message = N'The Selected Item batch is expired'
		               
		end
		
	 
	
	END

I have try this in good receipt document when input the existing batch. The updating and adding process success in batch window although i have already validate the expdate = getdate().

Does anyone can help me ?

Thanks in advance

Regards

Jiashun

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

the object type is 10000044  (not 1000004)

if @objtype= N'10000044' 

   

          BEGIN

Former Member
0 Kudos

Hi!

This could be possible via SDK.

Make Expiry Date Mandatory

Based on Expiry Date, your code should change the Batch Status to Locked

Former Member
0 Kudos

Hi Jiashun,

I believe SBO SP transaction notification doesn't work in batch selection windows, it only work when you add / update on the main document (Goods Receipt PO in your case) only. Maybe others could clarify on this matter.

Best Regards,

Hendry Wijaya