Skip to main content

Notifications

Announcements

No record found.

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

  • Romryan Profile Picture
    Romryan on at
    RE: Creating Item Journal in AL

    Bilal Haider,

    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.

  • Bilal Haider Profile Picture
    Bilal Haider 41 on at
    RE: Creating Item Journal in AL

    I do not understand what are you telling above.

  • Romryan Profile Picture
    Romryan on at
    RE: Creating Item Journal in AL

    Thank you for a quick response.

    I have done so but I got a breakpoint below on 

    NoSeriesManagement code unit.

    pastedimage1606112718725v1.png

  • Suggested answer
    Bilal Haider Profile Picture
    Bilal Haider 41 on at
    RE: Creating Item Journal in AL

    Inventory Setup numbering has nothing to do with this.

  • Suggested answer
    Bilal Haider Profile Picture
    Bilal Haider 41 on at
    RE: Creating Item Journal in AL

    Hi,

    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.

    No-series-code.PNG

    Code:

    ItemJournalBatch.GET('ITEM','ISSUE');
    DocNo := NoSeriesManagement.TryGetNextNo(ItemJournalBatch."No. Series",WORKDATE);

    Regards,

    Bilal Rai

  • Bilal Haider Profile Picture
    Bilal Haider 41 on at
    RE: Creating Item Journal in AL

    Are'nt you using DEFAULT as Item Journal batch ?

  • Romryan Profile Picture
    Romryan on at
    RE: Creating Item Journal in AL

    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

  • Suggested answer
    Bilal Haider Profile Picture
    Bilal Haider 41 on at
    RE: Creating Item Journal in AL

    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

  • Bilal Haider Profile Picture
    Bilal Haider 41 on at
    RE: Creating Item Journal in AL

    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

  • Romryan Profile Picture
    Romryan on at
    RE: Creating Item Journal in AL

    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

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans