We want to create a Job Queue which will post purchase documents in a specific state. You would have previously achieved this via looping through the purchase headers and calling If Codeunit.Run...In this scenario previously you were able to retreive an error message, example below.
if PurchaseHeader.findset() then
repeat
if not Codeunit.Run(Codeunit::"Purch-Post", PurchaseHeader) then
// Do something with GetLastErrorText
until PurchaseHeader.Next() = 0;
Importantly, the Job Queue Entry would not fail at this point either, as the error was handled separately. I found this blog post with a similar query, but does anyone know how this is achieved now.
https://github.com/microsoft/ALAppExtensions/issues/16362
Essentially, we want to post orders via a job queue, and store any errors on the document. But we do not want the Job Queue Entry itself to go into error.