Sorting records descending

idiotidiot Member Posts: 651
Hi

I have a problem with sorting records on a list form in descending manner.
Tried Ascending (false) but the cursor always goes to the oldest record which is now at the bottom of the list.
Is there any way to force the cursor to remain at the 1st record (latest record) at the top of the list form?
NAV - Norton Anti Virus

ERP Consultant (not just Navision) & Navision challenger

Answers

  • kinekine Member Posts: 12,562
    Set the sorting and then do FIND('-') or FINDFIRST (it depends on what you are doing after that...).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • idiotidiot Member Posts: 651
    Works!
    Thanks!
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • southindiansouthindian Member Posts: 247
    how to set the sorting in the list form..... client wants the latest Order no to be displayed in the top of the list form ......... i have tried the above option by coding


    SETCURRENTKEY("Document Type","Document Date","Location Code");
    FIND('-');


    but still it is not working ..... can any body help me immediately....
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Set property SourceTableView of the form to ORDER(Descending).
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • southindiansouthindian Member Posts: 247
    in my client place there are n number of sales person who generates order no sequencely..... actual thing is the latest order no which is generated must be in the top of the list and the curse Should point it...... even i tried it ... it is not working(the above option)....One more thing i had found that the key is not properly defined with resppective feilds .... kindly help me.....
  • southindiansouthindian Member Posts: 247
    i found outthat the key defined is problem which is not allowing me to sort out the way i want..... is there ia any way to sort out without including keys (even i do know that key is the only way to sort out either in ascending or descending)..... can any one guide me.............
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Yes, the key you selected will show you all Sales Orders day by day and separate them by the location.
    If all sales person are using the same No. Series then a key like "Document Type","Document Date" will work. If not you also have to generate creation time of the document and expand your key by "Creation Time".

    Don't forget to filter on "Document Type".
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • southindiansouthindian Member Posts: 247
    you got my point einsTeIn sir.... actually i am facing that problem only ...... i have a key defination with the required field ( Document Type,Document Date,Location Code ) ...... i have the feild creation time in the sales header table ... but it is not included in any key defination in Sales header. as per the above mentioned key it is filtering based on Document type , document date but the location code is issue which is disturbing and not allowing to sort the way i want to sort.... sir, is there ia any way to sort without defining a new kay... as the same table is used for two companies at a time...... kindly guide me
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Yes, there is a way, but it's very complex. I wouldn't suggest to use this way in your case. It's much easier and won't waste as much resources when you just insert a new key.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • southindiansouthindian Member Posts: 247
    atleast can i know what way it is sir..?????
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    You will have to base your Sales Order List on a temporary table and do the sorting on your own. That's really hard stuff.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • vijay_gvijay_g Member Posts: 884
    as the same table is used for two companies at a time...... kindly guide me

    if it is. then i don't think there may be any problem?
  • vijay_gvijay_g Member Posts: 884
    You will have to base your Sales Order List on a temporary table and do the sorting on your own. That's really hard stuff.
    that is only a way but even if you don't want to create only a key then this will be really so hard stuff to do.
Sign In or Register to comment.