Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Business Central updates!Learn about the key capabilities and features of Dynamics 365 Business Central and experience some of the new features.
Download overview guide | Watch Business Central video
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 2 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
Am creating an Item Journal in AL getting data from another system and its inserting data in the database table but unfortunately I can't see the journal itself in the item Journals page. what could be the issue?.
In which table you can see the data? Have you created the Item Journal Batch?
Hope this can help you to move forward.
Check your batch name.
Also try to look at the table directly and see what is not right. You can just append ?table=83 at your BC url.
Did you remember to add a valid journalname and journalbatch name to your data? You must use an item journal and an item journal batch name that is set up in your database in order to see the lines you create.
I changed ItmJnl.insert to ItmJnl.insert(true) and now I can see the journal but document number is not populated from the number series which I have already set and it's working when you enter Item Journal normally.
Also what's the difference between .insert and .insert(true).
Let me try to help you.
Document No population issue:
When you enter in Item Journal using page there is a function that is executed behind and that prepares line and also populates Document No. if No. Series is attached. That function is SetupNewLine. You may use this function.
Difference between Insert and Insert(True):
If you do not pass a Boolean value to Insert then by default it is False. It means that the record will be inserted in table but the code that is written in the OnInsert trigger will not executed. Similarly if you explicitly pass TRUE in Insert then it means during insertion the code written in the OnInsert trigger will also executed. e.g. in your case following is the code that will be executed when you use ItemJnl.Insert(True): Example is from NAV but its almost same in Business Central
As you can see that code is getting Journal Batch Name and Journal template so make sense why you were not able to see entries before.
Hopefully this will help you and please mark as verified if it answers your query.
Thank you so much for your response.
The below code cannot append the next document number while my Journal Batch name 'Default' has a number series attached to it. On the normal Item Journal, the next Document number is defaulted but the code can't. Sorry, how can I use SetupNewLine function to achieve the same.
If ItmJnlBatch."No. Series" <> '' then begin
ItmJnl."Document No." := NoSeriesMgt.TryGetNextNo(ItmJnlBatch."No. Series",WorkDate());
If you are already using the code that you have written above then you dont need to use SetupNewline function. It uses the same code that you have specified.
You are using right code to get next no based on No. Series. Can you show output by using MESSAGE function to see what is Document No after execution of NoSeriesMgt.TryGetNextNo. Also check that if you have got the ItemJnlBatch correctly. Have you used GET function for that ?
Also show the No series that you are saying is attached to Item Journal. One more thing do you have multiple Item Journal Templates or a only one ?
I have the message and its actually empty for the document number. Below is the Item Batch am using together with its number series. However, I have gone to Inventory set up and at the numbering section, I didn't see any option matching Item Journal transaction. The number series DOC you see below is set at number series section on administration.
Are'nt you using DEFAULT as Item Journal batch ?
I have created a new Item Batch and given it a No. Series. Then used this two line code and it worked perfectly fine. Please check that are you getting Item Journal Batch properly line no 1 in image.
ItemJournalBatch.GET('ITEM','ISSUE'); DocNo := NoSeriesManagement.TryGetNextNo(ItemJournalBatch."No. Series",WORKDATE);
Inventory Setup numbering has nothing to do with this.
Thank you for a quick response.
I have done so but I got a breakpoint below on
I do not understand what are you telling above.
Sorry for the misunderstanding. I have put the the piece of code you did on number series, but when I ran my routine of creating item Journal, The system freezes and open the al file that created the default NoSeriesManagement codeunit and the breakpoint (highlighted in yellowish thick line) occurs as per the black screen I had shared earlier.
Business Applications communities