cancel
Showing results for 
Search instead for 
Did you mean: 

Restriction for GRN not to Add more than1000 in Document total

former_member599281
Participant
0 Kudos

Hi Expert ,

my client is doing direct GRN and asking whenever in GRN , DocTotal is more than 1000 then it should  give error that first Add Purchase Order .

what is the store Procedure .....??

Please help me Out for this .

Thanks

Sarvesh Gupta

Accepted Solutions (1)

Accepted Solutions (1)

former_member205766
Active Contributor
0 Kudos

Hi

Try This

If @object_type='20' and @transaction_type in ('A','u')

BEGIN

If Exists (select * from PDN1 r inner join opdn r1 on r.docentry=r1.docentry

where isnull(r.Baseref,'') ='' and r1.DocType ='I' and r1.doctotal > 1000  and r1.DocEntry = @list_of_cols_val_tab_del   )

BEGIN

Select @error = -1,

@error_message = 'GRPO without PO is not allowed'

End

End

With Regards

Balaji Sampath

former_member599281
Participant
0 Kudos

Hi Balaji Sampath

it's working .

thanks

can u please check this link and help me out for this issue also ,

Alert for user of Purchase Request Created or Changed to another user .

Answers (1)

Answers (1)

KennedyT21
Active Contributor
0 Kudos

Try This

IF @object_type = '20'

         AND @transaction_type IN ('A', 'u')

      BEGIN

          IF EXISTS(

                 SELECT t1.docentry

                 FROM   opdn t1

                        INNER JOIN pdn1 t2

                             ON  t1.docentry = t2.docentry

                 WHERE  @list_of_cols_val_tab_del = t1.docentry and isnull(t2.BaseType ,'') =''

                        AND t1.DocTotal>='1000'

             )

          BEGIN

              SET @error = -1

            

              SET @error_message = 'You Cannot Perfrom this Action without Purchase Order'

          END

      END

Regards

Kennedy

former_member599281
Participant
0 Kudos

Hi

it's working .

thanks

can u please check this link and help me out for this issue also ,

Alert for user of Purchase Request Created or Changed to another user .

KennedyT21
Active Contributor
0 Kudos

Close the thread with the correct answer and helpful answers...

Regards