hi Laura Nesteriak
when you enter line total we can capture sum of quantity of all items before adding the document.
Add this simple query to UDF in the form of FMS so you can get sum of quantity for particular Document
SELECT sum(T1.[Quantity]) FROM ORDR A
INNER JOIN RDR1 B ON A.DocEntry = B.DocEntry WHERE A.docentry = $[ORDR.docentry]
Regards
Jenny