web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Posting to multiple item reclass journals

(0) ShareShare
ReportReport
Posted on by
Hi there,
I'm working on an extension to add lines to our item reclass journals. I am using the default /Item Reclass. Journal/ page to add the items and run a codeunit to call /Item Jnl.-Post Batch/ separately to post the batch. This all works as long as my user stays on the same batch. If I post items through the API to the current journal, all goes well. If I post to a journal that is not currently selected, then I get the error: 
The Item Journal Batch does not exist. Identification fields and values: Journal Template Name='TRANSFER',Name='' 
 
I have tried setting a filter on the Item Journal Line to the new batch and have run a codeunit to run ItemJnlManagement with an Item Journal Batch record set to the correct batch. Nothing seems to set the environment like opening the page, then running the API.
 
Here is the code I've tried to run immediately before posting the new record to the page:
procedure PostReclass(batchName: text; postItems: Boolean): Text    var        lrRec: Record /Item Journal Batch/;    begin        lrRec.Init();        lrrec.SetFilter(Name, batchName);        //lrRec.SetFilter(/Journal Batch Name/, batchName);        Codeunit.Run(codeunit::ItemJnlManagement, lrRec);        if lrRec.FindFirst() and postItems = true then begin            //repeat            CODEUNIT.RUN(CODEUNIT::/Item Jnl.-Post Batch/, lrRec);            //until rec.next = 0        end;        exit(lrRec.Name);    end;
 
then call 
the Journal_Batch_Name I'm passing in Json matches the batchName passed above and is a valid batch; yet it complains that there is no valid batch. Any help would be greatly appreciated!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 753 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 583 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 302 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans