Skip to Content
avatar image
Former Member

Block Purchase Order

Hello,

I am looking for a SP to block purchase order if the vendor is not in preferred vendor in item master

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 15, 2017 at 06:14 AM

    Hi Krishna,

    You can use the SP_TransactionNotification to block your PO based on your criteria.

    Pedro Magueija

    LinkedIn | Twitter | Blog

    Add comment
    10|10000 characters needed characters exceeded

  • May 15, 2017 at 12:30 PM

    Hi,

    Try this transaction notification:-

    IF @transaction_type IN (N'A', N'U') AND (@object_type = '22')

    BEGIN

    IF EXISTS( SELECT T0.DocEntry FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN ITM2 T2 ON T1.itemcode = T2.Itemcode WHERE T0.DocEntry = @list_of_cols_val_tab_del AND T0.CardCode NOT IN ( SELECT c.vendorcode FROM itm2 c WHERE c.itemcode=t2.itemcode) )

    BEGIN

    SELECT @Error = 13

    SELECT @error_message = 'SELECT Preferred vendor for creating PO'

    END

    END

    Add comment
    10|10000 characters needed characters exceeded