on 11-20-2008 7:14 PM
Hi,
I am creating an approval procedure for SO, checking balance, due inovices and payment terms. The approval should not be trigger when the SO is cash basic. The payment term cash basic has code -1. This is my query. I got the error Could not commit transaction.
What is wrong?
SELECT CASE WHEN T0.Balance+$[$29.0.NUMBER] > T0.CreditLine AND
$[ORDR.GroupNum] <> (-1 ))
OR
(
(SELECT COUNT(*) FROM [dbo].[OINV] T1 WHERE T1.DocDueDate<GetDate() AND T1.DocStatus='O' AND T1.CardCode = $[ORDR.CardCode]) > 0
AND
$[ORDR.GroupNum] <> (-1 )
)
THEN 'TRUE'
ELSE 'FALSE' END
FROM [dbo].[OCRD] T0
WHERE T0.CardCode = $[ORDR.CardCode]
Tks
Adriana
Hi Adriana,
By analyzing your logic, I simplified it. Please try this query:
SELECT Distinct 'TRUE' From dbo.OCRD T0, dbo.OINV T1
WHERE (T0.CardCode = $[$4.0.0]) AND ($[ORDR.GroupNum] !=N'-1') AND
((T1.DocDueDate<GetDate() AND T1.DocStatus='O' AND T1.CardCode = $[$4.0.0])
OR (T0.CreditLine - T0.Balance < $[$29.0.NUMBER]))
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
It can be a possibility that the issue may be related to the query written. Please check the query again.
Regards,
Jitin
SAP Business One Forum Team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.