Hi,
i have a Codeunit 50007 with one function, in this function i try to run the codeunit 80 - "Sales-Post", but i want to control the exceptions of this call to Codeunit 80, so i need to put a COMMIT command (view the code).
My question is, the use of the COMMIT could be dangerous? i explain mi question: this COMMIT could intercept, interfere or modify another process thrown by another user?
i annex the code:
procesarPedidoMODULA()
.
.
.
COMMIT;
IF regPedido.RUN(rccabped) THEN
BEGIN
// all OK
END ELSE BEGIN
// Error
sErrores := sErrores + ' E8';
rcCabecera.LOCKTABLE;
rcCabecera.Errores := sErrores;
rcCabecera.MODIFY;
rccabped.LOCKTABLE;
rccabped."Errores preparación" := sErrores;
rccabped.MODIFY;
REPORT.RUNMODAL(REPORT::"Listado Pedidos Prep. Errores",FALSE,TRUE,rcCabecera);
END;
Thanks
Nacho
0
Comments
You should just give the user the error.
To answer you question about the commit, Either put it in the beginning of CU.
OR at the end. Search for commits in CU 80 and you need to put your code in that section.
Also I would not run a report.modal during a posting routine.
It'll lock everybody else out.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.