Skip to Content
author's profile photo Former Member
Former Member

Query for Approval Procedure

Hi all,

I set up an approval procedure for sales orders, the term is based in this user query:

SELECT DISTINCT 'TRUE'  WHERE $[$38.14.Number]<$[$38.U_PrecMin.Number]

We need that query working for every single row of the sales order, because it only works when it's true on row one, but when a unit price is less than the value of that UDF on row two or above, the procedure does not work.

Any suggestion?

Thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on May 27, 2011 at 02:17 PM

    Sorry to say, but it is the limitation of the system that in an approval query you can check only data from the first line and at the header level.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2011 at 03:29 PM

    Hi,

    You may check this: approval-procedure-base-by-line

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2011 at 03:29 PM

    Hi......

    Try this in SP Transnotification.......

    If @Object_type='17' and (@transaction_type ='A' or @transaction_type ='U')
    BEGIN
    declare @Item1 as varchar(100)
    declare @minline1 int
    declare @maxline1 int
    declare @Price1 float
    declare @Price2 float
    set @minline1 = (select min(T0.linenum) from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del)
    set @maxline1 = (select max(T0.linenum) from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del)
    
    while @minline1<=@maxline1
    		begin
    		select @Item1=T0.itemcode from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and T0.linenum=@minline1			
    		select @Price1=T0.Price from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and  T0.linenum=@minline1
    			select @Price2=T0.U_PrecMin from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and  T0.linenum=@minline1
    		if 	@Price1<@Price2
    			begin
    				set @error=-1
    				set @error_message = 'Price is Less ' + @Item1
    			End
    			set @minline1=@minline1+1
    		end
    End

    Regards,

    Rahul

    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.