Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

how to create a bucket in nav 2009

(0) ShareShare
ReportReport
Posted on by 475

Hi guys,

  I would like print the invoices for each customer on the basis of 0-30,30-90. 90-150 days in NAV Classic client ..I have gone through the customer aging report as an example but I have no clue on how to do this.

Have anybody went through this earlier please help me on how to do that,

Warm Regards

Bharath K

Thanks in Advance

*This post is locked for comments

  • Suggested answer
    nav.mukesh Profile Picture
    nav.mukesh 617 on at
    RE: how to create a bucket in nav 2009

    Hi Bharat,

    Please check if the data (Posted Sales Invoices) exists for the other buckets. Hope the following details helps you to understand the code -

    Following code prepare the PeriodStartDate array variable

    Report-OnPreReport -

    (

    EVALUATE(PeriodLength,'<-1M>');

    FOR i := 3 TO 5 DO

     PeriodStartDate[i] := CALCDATE(PeriodLength,PeriodStartDate[i-1]);

    PeriodStartDate[6] := 31129999D;

    )

    Following Code filters the SalesInvoice and populate the bucket accordingly -

    Customer - OnAfterGetRecord()

    (

    FOR i := 2 TO 5 DO BEGIN

     SalesInvHead.SETRANGE("Sell-to Customer No.",Customer."No.");

     SalesInvHead.SETRANGE("Posting Date",PeriodStartDate[i],PeriodStartDate[i + 1] - 1);

     IF SalesInvHead.FINDFIRST THEN

       NoofPstdInvoices[i] := SalesInvHead.COUNT;

    END;

    )

    The following code is to skip the customer who doesn't have any invoice in any bucket -

    Customer - OnAfterGetRecord()

    (

    IF (NoofPstdInvoices[2]=0) AND

      (NoofPstdInvoices[3]=0) AND

      (NoofPstdInvoices[4]=0) AND

      (NoofPstdInvoices[5]=0) THEN

      PrintCust:=FALSE;

    )

  • bharathkarunakaran Profile Picture
    bharathkarunakaran 475 on at
    RE: how to create a bucket in nav 2009

    Hi mukesh,

    I checked the file that you have , in that only the 0-30 days section has  value in it and other sections did't have any value in it.

    Can you please explain the code ,and also why we are using a boolean printcust in the code,and also how the data  is being separated in that section.

    Warm regards

    Bharath K

  • Verified answer
    nav.mukesh Profile Picture
    nav.mukesh 617 on at
    RE: how to create a bucket in nav 2009

    Please send your object to me nav.mukesh@gmail.com. Which version are you working on?

  • bharathkarunakaran Profile Picture
    bharathkarunakaran 475 on at
    RE: how to create a bucket in nav 2009

    Hi mukesh

    1. I have put my code on OnAfterGetRecord Trigger only, because in customer aging report it is also present in the same trigger only.Is   this wrong?

    2. Can i know which is the wrong variable that i have used in the Design Section.

    Is desgin layout is correct ?

    I am using Customer and sales invoice header table for this report .

    Please tell the tables which I am using are right or wrong for showing the No,of pstd invoices in the Customer table on my table.

    Please advice.

    Warm Regards,

    Bharath K

  • Suggested answer
    nav.mukesh Profile Picture
    nav.mukesh 617 on at
    RE: how to create a bucket in nav 2009

    Hi Bharat,

    1. You have commented the code in OnAfterGetRecord and expecting the result to come

    2. You have used wrong variable in your RTC Layout.

  • bharathkarunakaran Profile Picture
    bharathkarunakaran 475 on at
    RE: how to create a bucket in nav 2009

    2018_2D00_03_2D00_15-16_5F00_47_5F00_34_2D00_CRONUS-USA_2C00_-Inc.-_2D00_-Microsoft-Dynamics-NAV-Classic-_2D00_-_5B00_Report-_2D00_-C_5F00_AL-Editor_5D00_.png2018_2D00_03_2D00_15-16_5F00_47_5F00_34_2D00_CRONUS-USA_2C00_-Inc.-_2D00_-Microsoft-Dynamics-NAV-Classic-_2D00_-_5B00_Report-_2D00_-C_5F00_AL-Editor_5D00_.png2018_2D00_03_2D00_15-16_5F00_48_5F00_04_2D00_CRONUS-USA_2C00_-Inc.-_2D00_-Microsoft-Dynamics-NAV-Classic-_2D00_-_5B00_Customer-_2D00_-C_5F00_AL-Editor_5D00_.png

    Hi Mukesh,

    I have tried whatever you have said but I am still unable to create the new report to show the no.of pstd invoices in an aging report.I have shown the code that I used and also the Report design which can help you more to guide me to achieve my output.

    Please help me on this.

    Warm regards,

    Bharath K

  • nav.mukesh Profile Picture
    nav.mukesh 617 on at
    RE: how to create a bucket in nav 2009

    Hi Bharat,

    If you will see in Request Page - You have Starting Date as the Starting Date for your bucket, Period Length is the length for the bucket(In your case, you will enter 30D,

    On PreReport the PeriodStartDate array will be populated with the values for the bucket.

    OnAfterGetRecord, this is calculating the value for each bucket and each customer from DetailedCustLedgEntry and PeriodStartDate.

    Please mark the Answer verified.

  • bharathkarunakaran Profile Picture
    bharathkarunakaran 475 on at
    RE: how to create a bucket in nav 2009

    Thanks you,

     One more thing can you help me on how to design the report part

    for 0-30,30-60,60-90 days and how these design parts are linked with code in customer aging report in nav .

    Please advice

    Bharath K

  • Suggested answer
    nav.mukesh Profile Picture
    nav.mukesh 617 on at
    RE: how to create a bucket in nav 2009

    Hi Bharat,

    Have you defined the dimension for the array variable - PeriodStartDate? You need to specify the length for the array by specifying the dimension.

    Please check the Property of PeriodStartDate.

      Property.png

  • bharathkarunakaran Profile Picture
    bharathkarunakaran 475 on at
    RE: how to create a bucket in nav 2009

    2018_2D00_03_2D00_13-10_5F00_35_5F00_01_2D00_CRONUS-USA_2C00_-Inc.-_2D00_-Microsoft-Dynamics-NAV-Classic-_2D00_-_5B00_Report-_2D00_-C_5F00_AL-Editor_5D00_.png2018_2D00_03_2D00_13-10_5F00_35_5F00_01_2D00_CRONUS-USA_2C00_-Inc.-_2D00_-Microsoft-Dynamics-NAV-Classic-_2D00_-_5B00_Report-_2D00_-C_5F00_AL-Editor_5D00_.png2018_2D00_03_2D00_13-10_5F00_36_5F00_05_2D00_CRONUS-USA_2C00_-Inc.-_2D00_-Microsoft-Dynamics-NAV-Classic-_2D00_-_5B00_Report-_2D00_-C_5F00_AL-Editor_5D00_.png

    Hi thanks for your reply,

    This is the error message that For my code.

    Please advice,

    Warm Regards,

    Bharath K

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans