on 2023 Sep 13 10:30 AM
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?
Request clarification before answering.
User | Count |
---|---|
10 | |
9 | |
5 | |
5 | |
4 | |
4 | |
3 | |
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.