Session.employeeCriteria is created by the cf_DisplayList custom tag, so if
you are using logic before the DisplayList tag, Session.employeeCriteria
will still have the criteria from the previous list.
You will need to process the incoming form fields manually, without relying
on cf_DisplayList to modify Session.employeeCriteria.
Dave
----- Original Message -----
From: "Jeff Fleitz" <[EMAIL PROTECTED]>
To: "[email protected]"
<[email protected]>
Sent: Tuesday, January 25, 2005 11:54 AM
Subject: [plum] DisplayList filtering with custom queries
I am trying to populate a list (EmployeeList) with a custom query, in
order to include grandparent info (company). The
query works fine, but I am trying to get it to honor embedded search form
fields which will change the EmployeeCriteria
session variable. I am trying to trap that and use it at the tail end of
the where clause, with no success. For some
reason the search criteria is not changing. If I revert back to the
default query, it runs fine. Any idea how I can do
this?
<cfscript>
// Select query parameters
selectClause = "Employee.EmployeeID AS Employee_EmployeeID,
Employee.OfficeID AS Employee_OfficeID, Company.CompanyID AS
Company_CompanyID, Company.CompanyName AS Company_CompanyName,
Office.OfficeID AS Office_OfficeID, Office.OfficeName AS
Office_OfficeName, Employee.LastName AS Employee_LastName,
Employee.FirstName AS Employee_FirstName, Employee.MiddleName
AS Employee_MiddleName, Employee.Title AS Employee_Title, Employee.Email
AS Employee_Email";
fromClause = "Company, Office, Employee";
whereClause = "Company.CompanyID = Office.CompanyID AND Employee.OfficeID
= Office.OfficeID AND #Session.employeecriteria#";
if(URL.sortOrder EQ 1)
orderByClause = "Employee.LastName ASC, Employee.FirstName ASC";
else
orderByClause = "Employee.Email ASC";
getEmployees =
Application.DatabaseBlocks.SelectRecords(selectClause:selectClause,
fromClause:fromClause,
whereClause:whereClause, orderByClause: orderByClause);
</cfscript>
Jeff
**********************************************************************
You can subscribe to and unsubscribe from lists, and you can change
your subscriptions between normal and digest modes here:
http://www.productivityenhancement.com/support/DiscussionListsForm.cfm
**********************************************************************
**********************************************************************
You can subscribe to and unsubscribe from lists, and you can change
your subscriptions between normal and digest modes here:
http://www.productivityenhancement.com/support/DiscussionListsForm.cfm
**********************************************************************