Skip to Content
avatar image
Former Member

Stored procedure to block delete specific type of Draft Document

Hi Dear,

How can I add control on stored procedure to block delete specific type of Draft Document, for example AR Invoice draft.

Following code not working, is there anyway to block it?

IF @object_type = '112'
BEGIN
    IF @TRANSACTION_TYPE = 'D'
    BEGIN    
        SELECT @error = -1, @error_message = 'Remove AR Invoice draft is not allowed'
        FROM ODRF T0
        WHERE T0.ObjType='13' AND T0.DocEntry = @list_of_cols_val_tab_del
    END    
END    

Please Help

Thanks in advance

Daisuki

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 13, 2015 at 06:52 AM

    Hi,

    Try:

    IF @object_type = '112' 

    BEGIN 

        IF @TRANSACTION_TYPE = 'U' 

    BEGIN     

    SELECT @error = -1, @error_message = 'Remove AR Invoice draft is not allowed' 

    FROM ODRF T0 

    WHERE T0.ObjType='13' AND T0.DocEntry = @list_of_cols_val_tab_del 

    END     

    END     

    Thanks & Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded