Skip to Content
avatar image
Former Member

Restrict A User From Changing A Payment Term While Adding A/R Invoice

Dear Experts,

We want to restrict our users from changing payment terms while adding A/R Invoice.

We use SAP B1 2007 b.

Thanking you

Pradnya

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    May 18, 2011 at 01:25 PM

    Hi Pradnya.......

    You can use SP transnotification or better if you use Approval Procedure.

    Regards,

    Rahul

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 18, 2011 at 01:39 PM

    Hi,

    try below code in transaction notification procedure:

    if (@object_type = '13') and (@transaction_type IN ('A', 'U')) 
    BEGIN
    IF exists (select T0.DocEntry FROM OINV T0 Inner Join OCRD T1 on T0.CardCode=T1.CardCode Where T0.GroupNum  !=T1.GroupNum and T0.DocEntry =@list_of_cols_val_tab_del)
    		Begin
    			SET @error = 30
    			SET @error_message =N'You are not authorized to change payment terms'	
    		end
    
    END

    for how the transaction notification works or how to use :

    check how-to-use-transaction-notification

    Thanks,

    Neetu

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi all,

      My sole purpose is to restrict user from changing Payment terms either through master or through transaction. For testing ,

      I tried on master in the test database.

      Thanks

  • avatar image
    Former Member
    May 18, 2011 at 01:51 PM

    Hi Pradnya.....

    Try this.....

    If @object_type='13' and @transaction_type='A'
    BEGIN 
    If Exists (Select * from [dbo].[OINV] T0 Inner Join INV1 T1 On T0.DocEntry=T1.DocEntry Left Join DLN1 T2 On T2.DocEntry=T1.BaseEntry Left Join ODLN 
    T3 On T2.DocEntry=T3.DocEntry
    Where T0.DocEntry = @list_of_cols_val_tab_del and T0.GroupNum <>T3.GroupNum)
    BEGIN
    Select @error = -1,
    @error_message = 'You can not change Payment terms'
    End
    End

    Regards,

    Rahul

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rahul,

      I have already tried something like this in test database on BP master.

      But no results.

      If @object_type='2' and @transaction_type='U'

      BEGIN

      If Exists (Select groupnum from ocrd Where T0.DocEntry = @list_of_cols_val_tab_del )

      BEGIN

      Select @error = -1,

      @error_message = 'You can not change Payment terms'

      End

      End

      Thanking you

      Pradnya

  • avatar image
    Former Member
    May 21, 2011 at 02:49 AM

    Hello,

    Have you solved the issue and finding the solution ?

    because first you define that which user can change your payment terms then your SP will work accordingly.

    i have made for same sales order.

    Thanks

    Manvendra Singh Niranjan

    Add comment
    10|10000 characters needed characters exceeded