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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Writing A comment

(0) ShareShare
ReportReport
Posted on by

I have a function which assigns a batch (See below) I want to create a separate function which adds a comment to the item Tracking Comments. In this comment it needs to add today's date and some text I can fill in.

37.PNG

This shows an example of the comment and the filters used to   show which record it's relating to.  The line number needs to Find which number it's on and make sure the next entry is on a unique line. 

Here are the primary keys for the comment page.

38.PNG

Any feedback on how to create this would be appreciated! 

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Here' the code which assigns the batch with variable names etc. 

    39.PNGThe yellow shows at which stage the comment function will be added! 

  • Community Member Profile Picture
    on at

    Progress so far 

    I've filtered the Item tracking Comments page and added a method to increment the line number.

     40.PNG 
    I need a method of automatically adding the date and text into the comment area. 

  • Verified answer
    Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi,

    This code will help you. GetNextNo() function will retrieve you the next number you can insert. Return type will be Integer

    recItemTrackingComment.INIT;
    recItemTrackingComment."Line No." := GetNextNo;
    recItemTrackingComment.Type := recSerialNoInformation.Type;
    recItemTrackingComment."Item No." := recSerialNoInformation."Item No.";
    recItemTrackingComment."Variant Code" := recSerialNoInformation."Variant Code";
    recItemTrackingComment."Serial/Lot No." := recSerialNoInformation."Serial No.";
    recItemTrackingComment.Date := TODAY;
    recItemTrackingComment.Comment := FORMAT(TODAY) + ' ' + 'SOME TEXT THAT YOU WANT TO SAVE';
    recItemTrackingComment.INSERT;


    GetNextNo--

    recItemTrackingComment1.RESET;
    recItemTrackingComment1.SETRANGE(Type, recSerialNoInformation.Type)
    recItemTrackingComment1.SETRANGE("Item No.", recSerialNoInformation."Item No.");
    recItemTrackingComment1.SETRANGE("Variant Code", recSerialNoInformation."Variant Code");
    recItemTrackingComment1.SETRANGE("Serial/Lot No.", recSerialNoInformation."Serial No.");
    IF recItemTrackingComment1.FIND('+') THEN
    EXIT(recItemTrackingComment1."Line No." + 10000)
    ELSE EXIT(10000);

  • Community Member Profile Picture
    on at

    Thank you! That's great

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans