I make two sales orders during a process, and I have to post them right away. If the system fails to post any of them under any circumstances, I would like it to roll back entirely.
Please share your knowledge about it.
Regards,
SB
Repeat
try
SalesPostCodeunit.Run(TempSalesOrderHeader); // Attempt to post Sales Order
catch
Error('Error posting Sales Order %1: %2', TempSalesOrderHeader."No.", GetLastErrorText());
// Raise the error to trigger rollback
until
André Arnaud de Cal... 291,429 Super User 2024 Season 2
Martin Dráb 230,503 Most Valuable Professional
nmaenpaa 101,156