Sorting the Sales Document - Test

sabzamsabzam Member Posts: 1,149
Hi Everybody,

I need to be able to sort the Sales Document - Test. I have been trying to define the sort of the Sales Line but it seems that the Navision is not taking it in consideration. Anyone has got any suggestions?

Comments

  • AlbertvhAlbertvh Member Posts: 516
    Remeber that it is being driven by the roundloop so you should set your sorting there.
    However you will have to be careful as this is being read with the
    TempSalesLine variable.
  • sabzamsabzam Member Posts: 1,149
    Hi Albertvh,

    What do you suggest, I should do? I can't place the usual group sorting and that stuff on the Roundloop since it's an integer and the only sorting type is number.

    I was thinking of setting up a setcurrentkey but it doesn't seem to be working because of the tempsalesline
  • sabzamsabzam Member Posts: 1,149
    Hi Everybody,

    This problem should be interesting to quite a number of you since it's quite complicated.

    I have managed to sort you the Sales Line by placing a sorting order in the codeunit which is being used since this can't be done from the loop. Now I need to group the line by a particular criteria. Anyhone has got any idea of how this should be done through coding? Please remember that we can't use the GroupTotalFields as usual.
  • AlbertvhAlbertvh Member Posts: 516
    Maybe use GroupTotalFields Number and in the code in
    AfterGetRecord assuming you are sorting by tempslaesline."No."

    if Number = 1 then begin
    tempsalesline.find('-');
    saveno := tempsalesline."no.";
    end else
    tempsalesline.next;


    create a GroupFooter Section and in Presection

    currreport.showoutput := saveno <> tempsalesline."no.";


    Just a thought :-k
  • emulsifiedemulsified Member Posts: 139
    Having the same problem. I have no idea how to apply a SORT to TempSalesLine driven by RoundLoop.

    My post: http://mibuso.com/forum/viewtopic.php?f=23&t=29026

    Any help or a step in the right direction is greatly appreciated.
    Half-empy or half-full how do you view your database?

    Thanks.
  • DaveTDaveT Member Posts: 1,039
    Hi Guys,

    If it the same as the above topic then

    use TempsalesLine.setcurrentkey( "Document Type",Type,"No.","Variant Code","Drop Shipment","Location Code","Shipment Date" ); and it should work
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.