Hi,
1. Thanks for feedback. My idea is if any one of the item quantity exceeds from sales quotation, then SP should go for approval.
2. Try this modified query to capture sum of quotation quantity
SELECT Distinct 'TRUE' FROM QUT1 T0 left join RDR1 T1 on T1.[BaseEntry] = t0.docentry and T1.[BaseLine] = T0.[LineNum] WHERE t0.docentry = $[$38.45.number] and T0.[ItemCode] = $[$38.1.0] GROUP BY T0.[Quantity] Having sum(T0.[Quantity]) < sum(T1.[Quantity])
3. By standard, we have to use 'True' in approval procedure. there is no need of getting sum of quantity in approval procedure.
Thanks & Regards,
Nagarajan