I have a grid with an initial filter that fires on the "OnGridExecute" event that I use to set filters based on a variable cUserType. If cUserType is "Rebator" then the following filter is set:
This code works as intended and shows only projects that have an Estimated Start Date less than 6 month ago into the future or a termination date greater than 13 months ago. If there is no termination date then the project is still active and we want to display those.
This works fine, but I'm trying to find a way to mimic this in the "BeforeSearch" event handler, but the only thing I see are the "SearchDataSubmitted" properties which don't allow me to submit compound values so I can do something like:
This only shows terminated dates greater than 13 months ago but now I can't add "OR IS NULL" to this property so I"m only returning the terminated projects.
There are also a number of Args.rtc properties like "sql_where" and "sql_final" but altering these has no effect.
I also tried copying the exact line from "OnGridExecute" event into the "BeforeSearch" event but it does nothing in the "BeforeSearch" event handler.
I'm wondering if there is a way to do what I want in xbasic with what Alpha passes back to the server or if I should just base the entire grid on stored procedures to get the filters I need.
Code:
e.tmpl.filter_initial = "p.EstSTADate < {" + DATE_FORMAT(ADDMONTHS(DATE(),6),"yyyy/MM/dd")+"} AND (p.ProjectTerminatedDate > {" +DATE_FORMAT(ADDMONTHS(DATE(),-13),"yyyy/MM/dd") +"} OR p.ProjectTerminatedDate IS NULL) "
This works fine, but I'm trying to find a way to mimic this in the "BeforeSearch" event handler, but the only thing I see are the "SearchDataSubmitted" properties which don't allow me to submit compound values so I can do something like:
Code:
SearchDataSubmitted.FROM.PROJECTTERMINATEDDATE = ShowProjectsXMonthsOut(-13, SearchDataSubmitted.FROM.PROJECTTERMINATEDDATE)
There are also a number of Args.rtc properties like "sql_where" and "sql_final" but altering these has no effect.
I also tried copying the exact line from "OnGridExecute" event into the "BeforeSearch" event but it does nothing in the "BeforeSearch" event handler.
I'm wondering if there is a way to do what I want in xbasic with what Alpha passes back to the server or if I should just base the entire grid on stored procedures to get the filters I need.
Comment