cancel
Showing results for 
Search instead for 
Did you mean: 

Could not commit transaction

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Gordon,

Once again you got it!!.

Tks

Adriana

Answers (1)

Answers (1)

jitin_chawla
Advisor
Advisor
0 Kudos

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