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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Insert Item Journal Line in Output Journal

(1) ShareShare
ReportReport
Posted on by 368
Hello!
 
I have made a CodeUnit that I want to use to insert an Item Journal Line. I am using the CodeUnit to insert and validate the Order No. and Item No. This works well, however, when I want to insert an Operation No., I get this error:
 
/The field Operation No. of table Item Journal Line contains a value (10) that cannot be found in the related table (Prod. Order Routing Line)./
 
This comes as a result of this line: 
OutputJournalLine.Validate(/Operation No./, '10');
 
I have hardcoded 10 now to simplify it, but this value will primarily be 10, 20 or 30. When I manually add a line in Business Central, I have to add the Order No. first, then Item No., and then I can insert the Operation No., I am using this same order in my Codeunit:
 
Later on in the code I set OutputJournalLine./Order No./ := OrderNo; and so on, and then I do OutputJournalLine.Insert() and Commit();
I have a PowerApps app that sends a JSON object, and everything works fine, except for this Operation No. insert.
 
 
I can see that the Routing No. is different depending on which Order No. and Item No. I insert, but the Operation No. 10 is consistent, and is the number that gets inserted in the cell if I press one of the lines in Business Central.
 
If I don't validate the Operation No. I can insert whatever I want into the field, but of course I want to validate it.
What am I missing or doing wrong?
 
I have the same question (0)

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 June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 647 Super User 2026 Season 1

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 447 Most Valuable Professional

#3
YUN ZHU Profile Picture

YUN ZHU 366 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans