Skip to Content

AP Vendor Ref

Hi all

How to prevent user editing Vendor Ref in AP Invoice after posting it?

Kedalene

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Dec 12, 2014 at 05:07 AM

    Hi,

    Possible by means of TN.

    Thanks & Regards,

    Nagarajan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2014 at 05:13 AM

    Hi,

    Also duplication can be avoided with the help of SP_TN.

    Regards,

    Dilli Babu S

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      To prevent editing of vendor reference number, try this:

      IF @transaction_type in ('U') AND (@OBJECT_TYPE='18')

      BEGIN

      If exists (SELECT T0.[DocNum] FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN ADO1 T2 ON T2.DOCENTRY = T1.DOCENTRY and T1.LineNum = T2.LineNum and T2.Objtype = T1.Objtype left JOIN ADOC T3 ON T2.DocEntry = T3.DocEntry WHERE T0.[NumAtCard] <> T3.[NumAtCard] and T0.DocEntry = @list_of_cols_val_tab_del )

      Begin

      SET @error = 10

      SET @error_message = 'Not allowed to change vendoe refer number'

      End

      End

      Thanks & Regards,

      Nagarajan

  • Posted on Dec 12, 2014 at 06:41 AM

    hi

    check Bellow Thread and Reffer Balaji Sampath omments

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 12, 2014 at 09:27 AM

    Hi,

    Try the below SP_TN

    IF @transaction_type IN ('U') AND @object_type = '18'and @error = 0

    BEGIN

    IF EXISTS (SELECT T0.DocNum FROM OPCH T0 INNER JOIN ocrd T1 on T1.CardCode=T0.CardCode WHERE T0.DOCENTRY = @list_of_cols_val_tab_del AND T0.NumAtCard is NULL)

    BEGIN

    SELECT @error = 8, @error_message = 'You can not edit the Vendor Ref No after Posting.'

    END

    END

    Regards,

    Manish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2014 at 11:03 AM

    Hi Kedalene

    Please try this :

    IF @transaction_type IN ('U') AND @object_type = '18'and @error = 0

    BEGIN

    IF EXISTS (SELECT T0.DocNum FROM OPCH T0 INNER JOIN ocrd T1 on T1.CardCode=T0.CardCode

    WHERE T0.DOCENTRY = @list_of_cols_val_tab_del AND T0.NumAtCard IS NOT NULL)

    BEGIN

    SELECT @error = 8, @error_message = 'You can not edit the Vendor Ref No after Posting.'

    END

    END

    Hope this may help u

    Regards,

    Bhushan Verma

    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.