Use TableFilter Field as Filter

ayashiayashi Member Posts: 78
Dear all,

If I have a field which has TableFilter DataType so that user can set the filter for table by them self. How do I apply this filter value into filtering the real table ? Is it possible to do this ?

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    You can store a filter in a text field. You can apply it in a form.

    I have done some testing with tablefilter but never used it in a real situation.
  • ayashiayashi Member Posts: 78
    Hi Marks, thank you so much for replying,

    I dont understand with your suggestion by saving the filter in text file ?
    r u saying that I have to load the filter data (from my custom table with tablefilter as filter field datatype) into text file, before load it into table ?

    How do I load the text into table as filter ?


    thanks before
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    You can store a filter by first programming it and then store it with GETVIEW.

    This returns the current filter setting and the key.

    You can apply is with SETVIEW.

    This is used in the Segments to store the criteria. Look at table Segment Criteria Line for examples.
  • ayashiayashi Member Posts: 78
    hi Mark,

    the problem is, I haven't applied the filter to the table, so I can't copied it.
    The filter is saved in my custom table in a field which has tablefilter data type. I alredy tried to apply the value of this field into the table using setfilter, but it doesn't work ](*,)
  • DduranDduran Member Posts: 22
    Hi,

    the table filters fields are not strored in database, it use in only temporal. When you execute a report with filters in a table filter fields you can do this:
    A report with this structure:

    Customer
    CustLedgerEntry

    v_Datefilter is a text variable(30)

    Customer data item with date filter field.

    onprereport event

    v_Datefilter:=customer.getfilter("Date filter");

    onpredataitem CustledgerEntry event

    Custledgerentery.setfilter("Posting Date",v_Datefilter)

    I hope this example can help you.

    Regards,
  • ayashiayashi Member Posts: 78
    this is where the prolem lay, if I hard code "Date Filter" Field, then if one day user wants to add another permisson, they have to contact developer to add this new field, since they don't have C/AL Lincese, any idea how to make things easier ?

    Thanks
  • OlaWoeOlaWoe Member Posts: 1
    You can by function convert the formated Tablefiltervalue to a Tableview
Sign In or Register to comment.