Skip to Content
author's profile photo Former Member
Former Member

Block the expired batch date

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2012 at 05:43 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2012 at 06:06 AM

    Hi!

    This could be possible via SDK.

    Make Expiry Date Mandatory

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2012 at 07:27 AM

    the object type is 10000044 (not 1000004)

    if @objtype= N'10000044'

    BEGIN

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.