Order all order/invoice pages by date by default

IvanGarciaSuberoIvanGarciaSubero Member Posts: 6
edited 2024-06-18 in NAV Three Tier
Hi,
every time I enter a page like Posted Sales Invoices, Sales Invoices, Sales Orders, Purchase Orders, etc, etc. I find the list of orders/invoices ordered by No., and in the case of Sales Order there is no order established by default, that's why I always need to click on the Document Date header and order it, so I make that clic about 1000 times a day...

I need a simple way of having all those pages ordered by default by the field I'm interested on. I have been searching and taking a look to configuration, personalice, etc, and I can't find a way to get that. I have tried to create a custom view, but I can't find a way of stablishing that view as default, so I need to click it any time I enter the page, so it's the same as clicking in the header... :(
oklbmcuz52wi.png


If there is no option, as alternative I can also program a page extension since I'm BC/AL programmer, but I'd like to make it the most scalable possible instead of having a new page extension for each page.

Any ideas?

Answers

  • IvanGarciaSuberoIvanGarciaSubero Member Posts: 6
    My solution right now is to extend each of the tables and specify each sort field in the OnOpenPage() trigger, it is tedious, any better or more scalable solution is welcome
    pageextension 56226 OrderPostedPurchaseInvoices extends "Posted Purchase Invoices"
    {
        trigger OnOpenPage()
        begin
            // Tras abrir la página ordenamos por fecha descendiente
            Rec.SetCurrentKey("Due Date");
            Rec.Ascending(false);
        end;
    }
    
    pageextension 56227 OrderPurchaseInvoices extends "Purchase Invoices"
    {
        trigger OnOpenPage()
        begin
            // Tras abrir la página ordenamos por fecha descendiente
            Rec.SetCurrentKey("Order Date");
            Rec.Ascending(false);
        end;
    }
    
    // etcetera
    
  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'General Chat' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • TallyHoTallyHo Member Posts: 416
    edited 2024-06-19
    If you are not getting the expected results, try SetView as below.

    trigger OnOpenPage()
    begin
    Rec.SetCurrentKey("No.");
    Rec.SetAscending("No.", false);
    Rec.SetView(Rec.GetView());
    if Rec.FindFirst() then;
    end;
Sign In or Register to comment.