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...
Suggested Answer

Creating Item Journal in AL

(0) ShareShare
ReportReport
Posted on by

Dear all,

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?.

I have the same question (0)
  • Suggested answer
    CarmenNunes Profile Picture
    on at

    Hello Rom,

    In which table you can see the data? Have you created the Item Journal Batch?

    Hope this can help you to  move forward.

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    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.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    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.

  • Romryan Profile Picture
    on at

    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).

  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    Hi

    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

    Item-Jnl-Insert.PNG

    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.

    Regards,

    Bilal Rai

  • Romryan Profile Picture
    on at

    Bilal Rai,

    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

      Clear(NoSeriesMgt);

      ItmJnl."Document No." := NoSeriesMgt.TryGetNextNo(ItmJnlBatch."No. Series",WorkDate());

    End;

    Regards,

    RomRyan

  • Bilal Haider Profile Picture
    414 on at

    Hi RomRyan,

    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.

    Setupnewlin.PNG

    Regards,

    Bilal Haider

  • Suggested answer
    Bilal Haider Profile Picture
    414 on at

    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 ?

    Regards,

    Bilal Rai

  • Romryan Profile Picture
    on at

    Bilal Rai,

    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.

    pastedimage1606066533547v1.png

    pastedimage1606066554283v2.png

    pastedimage1606066727667v1.png

    Regards,

    RomRyan

  • Bilal Haider Profile Picture
    414 on at

    Are'nt you using DEFAULT as Item Journal batch ?

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 2,238

#2
YUN ZHU Profile Picture

YUN ZHU 773 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 630

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans