Passing Setfitlers through Functions

sabzamsabzam Member Posts: 1,149
Dear All,

I would like to pass a number of setfilter to a function but instead of passing one by one I would like to use the copyfilter. Can anyone give me some guidance on this pls?

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi,

    What are you trying to achieve?

    Have you tried passing down a filter record variable and copyfiltler from that ?
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • sabzamsabzam Member Posts: 1,149
    I have applied 3 setfilters to a record variable in function a in codeunit a. I have passed the record into Function B in codeunit B. When I am trying to use the copyfilters in function B the filters are not passing over.
  • DaveTDaveT Member Posts: 1,039
    Hi,

    How are you setting the filters?

    Look at this post
    viewtopic.php?f=23&t=29933&hilit=pass+filters
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • sabzamsabzam Member Posts: 1,149
    I am using the %1 thing as well as passing the variable as type var into the function but to no avail.
  • BeliasBelias Member Posts: 2,998
    you can pass the entire record variable, it will maintain the filters you set.
    *EDIT: just noticed i didn't told that you have to pass the variable by ref in order to obtain the filter set with this method, sorry :oops:

    alternatively (never tried before) you can pass the result of GETVIEW function as a parameter and use SETVIEW to replicate the set of filters
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • DaveTDaveT Member Posts: 1,039
    Hi,

    Is it a local v's global variable problem?
    Dave Treanor

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