Filter table with closed date > 21 days ago
Filter table with closed date > 21 days ago
i thought this would be easy but i am struggling to filter a table. I am looking for a way to filter based on a number of days.
Appgini 5.72
Re: Filter table with closed date > 21 days ago
Hi,
what kind of filter are you looking for? Can you show an example.
what kind of filter are you looking for? Can you show an example.
Re: Filter table with closed date > 21 days ago
This works for me:
Replace YOURTABLENAME and set field-number.
You may have a look here:
https://bigprof.com/appgini/tips-and-tu ... ult-filter
https://bigprof.com/appgini/tips-and-tu ... ers/part-1
Hope this helps,
Regards,
Jan
Code: Select all
function YOURTABLENAME_init(&$options, $memberInfo, &$args) {
$field_number = 6; // CHANGE THIS!
$options->AllowFilters = true;
addFilter(1, 'and', $field_number, '<', date('d/m/Y', strtotime('-21 days')));
return TRUE;
}
You may have a look here:
https://bigprof.com/appgini/tips-and-tu ... ult-filter
https://bigprof.com/appgini/tips-and-tu ... ers/part-1
Hope this helps,
Regards,
Jan
Re: Filter table with closed date > 21 days ago
thanks jsetzer, I was hoping to create a link in the nave menu for this, is there a way to do that?
Appgini 5.72
Re: Filter table with closed date > 21 days ago
here is an example pbottcher
Code: Select all
$navLinks[] = array(
'url' => 'http:xxxxxxxxxxxxxxxxxxxxxx/WDCD_view.php?SortField=8&SortDirection=asc&FilterAnd%5B1%5D=&FilterField%5B1%5D=8&FilterOperator%5B1%5D=like&FilterValue%5B1%5D=CD&FilterAnd%5B2%5D=and&FilterField%5B2%5D=21&FilterOperator%5B2%5D=not-equal-to&FilterValue%5B2%5D=Closed+Cancelled&FilterAnd%5B3%5D=and&FilterField%5B3%5D=21&FilterOperator%5B3%5D=not-equal-to&FilterValue%5B3%5D=Closed+Lost&FilterAnd%5B4%5D=and&FilterField%5B4%5D=21&FilterOperator%5B4%5D=not-equal-to&FilterValue%5B4%5D=Closed+Won&FilterAnd%5B5%5D=and&FilterField%5B5%5D=21&FilterOperator%5B5%5D=not-equal-to&FilterValue%5B5%5D=Won&FilterAnd%5B6%5D=and&FilterField%5B6%5D=21&FilterOperator%5B6%5D=not-equal-to&FilterValue%5B6%5D=Cancelled&FilterAnd%5B7%5D=and&FilterField%5B7%5D=21&FilterOperator%5B7%5D=not-equal-to&FilterValue%5B7%5D=Lost',
'title' => 'CD Exc Lost/Closed Opps',
'groups' => array('*'), // groups allowed to see this link, use '*' if you want to show the link to all groups
'icon' => '',
'table_group' => '3' // optional index of table group, default is 0
);
Appgini 5.72
Re: Filter table with closed date > 21 days ago
Hi you can try this:
I added
&FilterOperator%5B8%5D=less-than&FilterValue%5B8%5D='.$filterdate at the end of your filter.
Code: Select all
$filterdate= date('Y-m-d',strtotime('-21 days'));
$navLinks[] = array(
'url' => 'http:xxxxxxxxxxxxxxxxxxxxxx/WDCD_view.php?SortField=8&SortDirection=asc&FilterAnd%5B1%5D=&FilterField%5B1%5D=8&FilterOperator%5B1%5D=like&FilterValue%5B1%5D=CD&FilterAnd%5B2%5D=and&FilterField%5B2%5D=21&FilterOperator%5B2%5D=not-equal-to&FilterValue%5B2%5D=Closed+Cancelled&FilterAnd%5B3%5D=and&FilterField%5B3%5D=21&FilterOperator%5B3%5D=not-equal-to&FilterValue%5B3%5D=Closed+Lost&FilterAnd%5B4%5D=and&FilterField%5B4%5D=21&FilterOperator%5B4%5D=not-equal-to&FilterValue%5B4%5D=Closed+Won&FilterAnd%5B5%5D=and&FilterField%5B5%5D=21&FilterOperator%5B5%5D=not-equal-to&FilterValue%5B5%5D=Won&FilterAnd%5B6%5D=and&FilterField%5B6%5D=21&FilterOperator%5B6%5D=not-equal-to&FilterValue%5B6%5D=Cancelled&FilterAnd%5B7%5D=and&FilterField%5B7%5D=21&FilterOperator%5B7%5D=not-equal-to&FilterValue%5B7%5D=Lost&FilterField%5B8%5D=21&FilterOperator%5B8%5D=less-than&FilterValue%5B8%5D='.$filterdate,
'title' => 'CD Exc Lost/Closed Opps',
'groups' => array('*'), // groups allowed to see this link, use '*' if you want to show the link to all groups
'icon' => '',
'table_group' => '3' // optional index of table group, default is 0
);
&FilterOperator%5B8%5D=less-than&FilterValue%5B8%5D='.$filterdate at the end of your filter.
Re: Filter table with closed date > 21 days ago
Thanks pböttcher, tried this now but the filter on the date is not working it just shows all records.
Appgini 5.72
Re: Filter table with closed date > 21 days ago
Hi,
sorry I forgot to state that you need to adjust the filter to match your date field. In my sample I used field nr. 21, but yours is for sure different.
FilterField%5B8%5D=21
sorry I forgot to state that you need to adjust the filter to match your date field. In my sample I used field nr. 21, but yours is for sure different.
FilterField%5B8%5D=21