Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Totals Group by Shipment Date

Posted on by Microsoft Employee

Can anyone tell me if there is an example anywhere in NAV 2013r2 that I can look at for the following:  I have a page that sets filters on the Sales Header table.  I would call another page from the ribbon and on this page I would like to have a summary of information that is contained on the first page of the following information;

SELECT [SHIPMENT DATE], WeekdayName(DatePart("w",Fields!ShipmentDate.Value),True,0), COUNT(*)

I have already created a report with this information now I need a page. Thank you

*This post is locked for comments

  • Suggested answer
    4BzSoftware Profile Picture
    4BzSoftware 6,071 on at
    RE: Totals Group by Shipment Date

    Hi Kim,

    You can try FlowField.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Totals Group by Shipment Date

    will give it a try thank you

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Totals Group by Shipment Date

    Well use the COPYFILTERS function to copy the filter from the selected record and then remove the primary key filters to loop through

    Ex: CreateTempDataSet(SalesHeader) -- > Where salesheader is the selected from first page

    SalesHeader2.COPYFILTERS(SalesHeader);

    SalesHeader2.SETRANGE("No.");

    IF SalesHeder2.FINDSET THEN

    REPEAT

    // Here you do SETRANGE on TEmp To find if the Group by field already exist if not insert otherwise modify.

    TempSalesHeader := SalesHeader2;

    TempSalesHeader.INSERT;

    UNTIL SalesHEader2.NEXT = 0;

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Totals Group by Shipment Date

    OK, well that part worked thank you, I used a query object.  But bow I need to get the filters from the initial page applied to the query or temporary table, so that it only groups and displays from the data on the initial page.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Totals Group by Shipment Date

    Kim

    I am not sure if there is a place in standard NAV with this functionality but to achieve your requirement you can do the following

    When you call the action from the ribbon, add a function which will create your dataset in the temporary table and use that as source for the page.

    When you insert data into temporary table look for the group by field if that value already exists update the existing record with Count.

    Thanks

    Suresh

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Totals Group by Shipment Date

    I  forgot to add the group by at end of query sorry:(

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans