Options

multi selection

AmaraaAmaraa Member Posts: 153
Hello,

How can I select multi values from Dimension Value Table.

I can have a text field with "ClearonLookup" property set to No. Then the problem rises when I select same combination with different order (a,b,c = c,a,b). Since I set the field's data type as field I'm facing the ordering issue.

How can I make multi selection that orders by dimension value's code and return me 1 string? :cry::cry::cry:

Please, help! ](*,)
Amaraa

Answers

  • Options
    matttraxmatttrax Member Posts: 2,309
    Well if you have a string with all of the values in it you can do just about anything.

    Start by parsing the string. Anytime you get to a comma you know you have finished with the last value. When you have all of the values you can sort them in whatever way you want. Could be with an array, a temp table, whatever.

    Once you're done combine them back into a string.

    Hope that pushes you in the right direction.
  • Options
    DaveTDaveT Member Posts: 1,039
    Hi,

    Have a look at the standard customer list form - function similar to GetSelectionFilter() is what you want
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • Options
    AmaraaAmaraa Member Posts: 153
    DaveT wrote:
    Hi,

    Have a look at the standard customer list form - function similar to GetSelectionFilter() is what you want
    it worked fine, thanks.

    is there anyway that I can take all values with '|' delimiter? I don't want the '..' be there and hide the values between.
    Sorry, I'm new in Navision so I don't understand the code fully, and for now I have no idea how to change that.

    Thanks for your advise,
    Amaraa
  • Options
    DaveTDaveT Member Posts: 1,039
    Hi Amaraa,

    You just need to simplify the routine
    e.g.
    CurrForm.SETSELECTIONFILTER(Cust);
    Cust.MARKEDONLY(TRUE);
    IF Cust.FIND('-') THEN BEGIN
        repeat
          IF SelectionFilter <> '' THEN
            SelectionFilter := SelectionFilter + '|';
    
          SelectionFilter := SelectionFilter + Cust."No.";
        until cust.next = 0;
    END;
    EXIT(SelectionFilter);
    

    Watch the length of SelectionFilter - it's only declared for 250 characters.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • Options
    matttraxmatttrax Member Posts: 2,309
    IF STRLEN(SelectionFilter + '|' + Cust."No.") > MAXSTRLEN(SelectionFilter) THEN
      ERROR('You selected too much!');
    
    IF SelectionFilter <> '' THEN
      SelectionFilter := SelectionFilter + '|';
    
    SelectionFilter := SelectionFilter + Cust."No.";
    
    

    Might want to add something similar to that. My addition doesn't exactly follow NAV coding rules :D
  • Options
    AmaraaAmaraa Member Posts: 153
    PERFECT!!!

    I appreciate your help. =D>

    Thanks,
    Amaraa
  • Options
    DaveTDaveT Member Posts: 1,039
    Glad to Help :mrgreen:
    Dave Treanor

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