20. Dezember 2017 15:09
20. Dezember 2017 16:46
[...]
IF Cust.Notification = Cust.Notification::"E-Mail" THEN BEGIN  // z. B. irgendwo am Anfang
  GlobalVarMgt.SetVar('SendNotificationMail',''Yes');
END;
[...]
GlobalVarMgt.SetVar('SalesPostFinished','Yes');  // Ganz am Ende des OnRun-Triggers der CU 80[...]
CODEUNIT.RUN(CODEUNIT::"Sales-Post",SalesHeader);
IF GlobalVarMgt.GetVar('SalesPostFinished') <> 'Yes' THEN BEGIN
  GlobalVarMgt.DelVar('SendNotificationMail');
END;
IF GlobalVarMgt.GetVar('SendNotificationMail') = 'Yes' THEN BEGIN
  MailMgt.SendNotification(Rec);
  GlobalVarMgt.DelVar('SendNotificationMail');
END;20. Dezember 2017 16:50