I have a user defined field that gets updated with this query.
SELECT CASE WHEN $[OCRD.Currency] = '$' THEN ISNULL((SELECT SUM(DocTotal - PaidToDate) FROM OINV WHERE CardCode = $[OCRD.CardCode] AND DocStatus = 'O'), 0) - ISNULL((SELECT SUM(DocTotal - PaidToDate) FROM ORIN WHERE CardCode = $[OCRD.CardCode] AND DocStatus = 'O'), 0) ELSE ISNULL((SELECT SUM(DocTotalFC - PaidFC) FROM OINV WHERE CardCode = $[OCRD.CardCode] AND DocStatus = 'O'), 0) - ISNULL((SELECT SUM(DocTotalFC - PaidFC) FROM ORIN WHERE CardCode = $[OCRD.CardCode] AND DocStatus = 'O'), 0) END
This field opens a custom window but it does not show all the documents after a certain point. Is it an error in the query or the add-on we have developed?