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

Notifications

Announcements

No record found.

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 311
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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans