I have written a c#.net app to create Output Journals (using a web service to the Output journal page). But I want it to post the line too. I have tried making a code unit web service to unit 22 but visual studio will not link to it. So I made a code unit that attempts to post all "Output" entries.
Here is a snippet just doing one record. (jnl is a local record variable and postitem is a local codeunit 22 var)
IF jnl.FINDFIRST THEN
EntryType := jnl."Entry Type"::Output;
jnl.SETFILTER("Entry Type", 'Output');
IF jnl.FINDSET THEN
postitem.RunWithCheck(jnl);
It does seem to post the journal to Capacity Ledger, but the Journal entry is still there.
I would only want to delete the entry if I am sure that it was successfully posted.
What am I doing wrong ?