Quantcast
Channel: Microsoft Dynamics NAV Forum - Recent Threads
Viewing all articles
Browse latest Browse all 29197

How to use code unit 22 to post Output Journals

$
0
0

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 ?


Viewing all articles
Browse latest Browse all 29197

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>