Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

data not assigning in Reports

Posted on by 200

In NAV tem journal line reports, I have added a code to get unit price of the Item and my report table name is Item journal line.

Item.RESET;

Item.SETRANGE(Item."No.",RecItemJn."Item No.");

IF Item.FINDFirst THEN

"Unit Price" := Item."Unit Price";

 

But It returns zero value but actually it has data in Item. I have added this code both in Item Journal Line - OnPreDataItem() and Item Journal Line - OnAfterGetRecord()

 

 

 

Any Ideas! Thanks in Advance

*This post is locked for comments

  • RE: data not assigning in Reports

    Thanks for your response Andrey..But it doesn't work

  • RE: data not assigning in Reports

    Thank You very much Suresh Kulla..Its working!!

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: data not assigning in Reports

    You need to add the code in the OnAfterGetRecord.

    What is RecItemJnl is it a variable then it will not have the Item Journal Line Record, if you are just looking for reporting purpose only  then create a variable called UnitPrice (Decimal) then use the following code

    CLEAR(UnitPrice);

    IF Item.GET("Item Journal Line"."Item No.") THEN

    UnitPrice := Item."Unit Price"

    If you have want to reflect that value in the journal then you need to assign the unit price to the Unit Price field and use the Modify statement.

  • Suggested answer
    Andrey Baludin Profile Picture
    Andrey Baludin 3,941 on at
    RE: data not assigning in Reports

    You forgot Modify.

    Next way:

    Item.RESET;

    Item.SETRANGE(Item."No.",RecItemJn."Item No.");

    IF Item.FINDFirst THEN BEGIN

     "Unit Price" := Item."Unit Price";

     MODIFY;

    END;

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans