Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One ComboBox, 2 or More Destinations!

Status
Not open for further replies.

PDL

IS-IT--Management
Dec 11, 2000
36
0
0
US
I use a phonebook to populate fields in an application. When it was one field (actionee), all was OK. We added two fields being AssignedBy and CloseoutAuthoriy... whcih meant we had to query and build the dropdowm list three times.

There are 4000+ names in the list... so, the times is fairly long to get the page to load!

Does anyone have a trick that would allow me to query the phonebook ONCE, highligh the name I need and do something to move it to ONE or MORE fields?

Scenario... pick a name, put in AssignedBy .... pick another name from the same dropdown, this time MOVE IT to another field, say Actionee, and then pick another name from the same dropdown and use it to populate the CloseoutAuthority field.

I am after a means of only building the phonebook drop down ONCE instead of many times!

Any help appreciated!

 
to use persistant queries you can simply use cachedwithin in the cfquery tag:
<CFQUERY NAME=&quot;queryName&quot; DATASOURCE=&quot;dbn&quot; cachedwithin=&quot;#CreateTimeSpan(1, 0, 0, 0)#&quot;>
sql
</CFQUERY>

CreateTimeSpan(day, hrs, min, sec), creates a date/time object that defines a time span or time period. You can add or subtract this time period from other date/time objects and use it with the CACHEDWITHIN attribute of CFQUERY


if you are going to need to execute query with new user, bt want to store the result for the existing one and don't want to execute query with every page request, you can store the query result in the variable:

<CFQUERY NAME=&quot;queryName&quot; DATASOURCE=&quot;dbn&quot;>
select fieldName
from tableName;
</CFQUERY>

<cfset session.varName = queryName>

<cfoutput query=&quot;session.varName&quot;>#fieldName#<br></cfoutput>

bottom line, whatever you do you can store it in the session or application variables and use it throughout your application;

hope this help :) Sylvano
dsylvano@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top