cancel
Showing results for 
Search instead for 
Did you mean: 

Could not commit transaction: Error -1 detected during transaction '' (RDR1)

tgyc001
Explorer
0 Kudos
289

Hello everyone,

I am facing a problem when creating the delivery.

We wrote this request in order to refine the concept of credit limit in SAP business One which consists of sending the document for approval when the credit limit is reached.

Attached is the request.

DECLARE @CREDIT DECIMAL(18,2);

SELECT T0."CreditLine" INTO CREDIT FROM OCRD T0 WHERE T0."CardCode" = $[ODLN."CardCode"] AND T0."GroupCode" IN (122,123);
IF :CREDIT = 0 THEN
    SELECT DISTINCT 'true' FROM OCRD T0 
        WHERE T0."CardCode" = $[ODLN."CardCode"] AND T0."Balance" + $[ODLN."DocTotal"] + (SELECT T1."OrdersBal" FROM OCRD T1 WHERE T1."CardCode" = $[ODLN."CardCode"]) + (SELECT T2."DNotesBal" FROM OCRD T2 WHERE T2."CardCode" = $[ODLN."CardCode"] ) > 0;
END IF;
IF :CREDIT > 0 THEN
    SELECT DISTINCT 'true' FROM OCRD T0 
        WHERE T0."CardCode" = $[ODLN."CardCode"] AND T0."Balance" + $[ODLN."DocTotal"] + (SELECT T1."OrdersBal" FROM OCRD T1 WHERE T1."CardCode" = $[ODLN."CardCode"] ) + (SELECT T2."DNotesBal" FROM OCRD T2 WHERE T2."CardCode" = $[ODLN."CardCode"] ) > :CREDIT;
END IF;

We have this error message:

Could not commit transaction: Error -1 detected during transaction '' (RDR1)

Can you please help me resolve the problem?

Accepted Solutions (0)

Answers (0)