#7119
ago
Participante

Hola

Lo que he hecho es lo siguiente :

Subscripción a la función OnBeforeConfirmSalesPost de Codeunit 81

y meto este código :

HideDialog := NOT HideDialog;

WITH SalesHeader DO BEGIN
CASE “Document Type” OF
“Document Type”::Order:
BEGIN
Selection := STRMENU(ShipInvoiceQst,1);
Ship := Selection IN [1,3];
Invoice := Selection IN [2,3];
IF Selection = 0 THEN
ERROR(‘Proceso cancelado’);

END;

“Document Type”::”Return Order”:
BEGIN
Selection := STRMENU(ReceiveInvoiceQst,1);
IF Selection = 0 THEN
ERROR(‘Proceso cancelado’);
Receive := Selection IN [1,3];
Invoice := Selection IN [2,3];
END
ELSE
IF NOT CONFIRM(PostConfirmQst,FALSE,LOWERCASE(FORMAT(“Document Type”))) THEN
ERROR(‘Proceso cancelado.’);
END;
“Print Posted Documents” := FALSE;
END;

 

Se trata de una copia de la función ConfirmPost de la codeunit 81 , cambiando el 3 por el 1.

Incluso las variables utilizadas , incluidas las TEXT CONSTANTS son copiadas de la codeunit.

Espero sea de utilidad.

Un saludo

Register New Account