First Character

siyaksiyak Member Posts: 66
Hi pips!! i working on the account types then what i want to see is on the customer is the account type start with the 'T'(filtering),i don't know whether i on the correct direction by using the COPYSTR(ACCTYPE,1,1).Please help i want to filter by That and don't see the other ones

Comments

  • XypherXypher Member Posts: 297
    Are you looping through some filtered records that may or may not have 'T' in the beginning of the Account Type?

    Or would you just like to filter FOR customers with account types beginning with 'T'?


    If yes for the first one, you could do...
    IF ACCTYPE[1] := 'T' THEN
      ....
    //I assume account type is Code datatype so you don't have to worry if it will be 't' or 'T'
    
  • AlbertvhAlbertvh Member Posts: 516
    Hi

    You could also do this
    SETFILTER("Account Type",'%1','T*');
    


    Albert
  • garakgarak Member Posts: 3,263
    if you will use a filter, use following:

    YourRecordvariable.setfilter(YourFieldToFilter,'%1','T*');
    Do you make it right, it works too!
  • XypherXypher Member Posts: 297
    garak wrote:
    if you will use a filter, use following:

    YourRecordvariable.setfilter(YourFieldToFilter,'%1','T*');


    Soooooo late garak :D
  • siyaksiyak Member Posts: 66
    I'm using the matrix form,i just wanna know where i can put this code.I already have the code
  • SavatageSavatage Member Posts: 7,142
    you really want to set this code in stone with "T"?
    are you going to keep changing the code? say next you want to filer "S"

    Do you want it dynamic? Like adding a textbox on the form and whatever letter you enter into it - the form will filter on it?

    Was F7 -> typing T* not possible?
  • garakgarak Member Posts: 3,263
    yes :-( to late :-(
    Do you make it right, it works too!
  • siyaksiyak Member Posts: 66
    Thanks guyz that what i have,but what i want is:i have a matrix form and it belong to the location so i cannot put this code(CurrForm.MatrixForm.MatrixRec.SETRANGE("Account Type Dimension",'%1','T').
    On the Matrix form i have (Customer No and Account Type Dimension) and on the Matrix field i have the (Location Code),so i just wanna know where i can put this Code(.SETRANGE("Account Type Dimension",'%1','T').
    There Client does not want tu press F7 and T*,they want it filtered already!! ](*,)
  • SavatageSavatage Member Posts: 7,142
    how about go to your form
    tools->designer
    View->Properties
    **Use assist Button**
    SourceTableView->WHERE (Account Type Dimension=FILTER(T*))
  • krikikriki Member, Moderator Posts: 9,110
    SETRANGE("Account Type Dimension",'%1','T')
    
    Will NEVER be accepted by Navision. It means you want to filter all values from '' to 'T'.
    You need to use
    SETFILTER("Account Type Dimension",'T*')
    

    or also (like you wrote in your other topic:
    SETRANGE("Account Type Dimension",'T001','T999')
    

    This last will filter out "TA" => "TB". I don't know if you have those values or if you want to filter them out.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.