I have Table 1 in which I have a field Cost Center that is defined as a flow filter. On a form (whose source table is Table 1) the user will enter a Cost Center range as a filter (the user could enter multiple cost centers using the | symbol). I need to display all saleslines that have cost centers that fall within the Cost Center filter field of Table 1. Is there anyway I can use the values in the Cost Center flow filter of Table 1 to SETRANGE on the cost center field of the Sales Line table? Thanks. Pari somasundaram
Through code? Sure, do:
SalesLine.SETFILTER("Cost Center",Table1.GETFILTER("Cost Center Filter"));
I think COPYFILTER works the same (but looks a bit cleaner?): Table1.COPYFILTER(“Cost Center Filter”,SalesLine.“Cost Center”);
Thank you. I will try it. Pari Somasundaram
Thanks Chris, I didn’t remember COPYFILTER.
I’m sorry if this is a stupid question. Each user can simultaneously query on the sales line table. So I have decided to create 2 fields in the User Setup table Cost Center Filter Date Filter I will create a form (source table User Setup) which when opens the user can enter the cost center filter and Date filter. This form will also have a button called Job Performance. After entering the filters, if the user clicks on the button, it will open another tabular form (say Form 2) that will display all sales lines within the filters. I now need to pass the filters to Form 2 to filter the sales line. Can we pass filters through form functions? Alternatively, can filter values be stored (saved) in the User setup table fields? If so all I need to do is save the record before opening Form 2. Thanks. Pari Somasundaram
Try something like this:
// Apply filters - use filtergroup CLEAR(MySalesLine); FILTERGROUP(2); MySalesLine.SETFILTER("Cost Center", CostCenterFilter); MySalesLine.SETFILTER(Date, DateFilter); FILTERGROUP(0); // Call form CLEAR(MyForm2); MyForm2.SETTABLEVIEV(MySalesLine); MyForm2.RUNMODAL; Define your filters as flowfields in the User Setup table - alternatively define and use some textvariables.