Have you tried dumping the form and aborting before calling the function?

I would think that the if your doing it the way you are the cfparam is not
needed, because the function should default the criteria anyway, and then
checl to see if the criteria is eq to anyting before inserting it into the
DB.

My guess that the form is holding 2 copies of the data to begin with, and
the only way to know this is to do the following.

<cfparam name="FORM.criteria" default="">

 <!--- Call the DAO  for categories--->
  <cfset prodcategories = APPLICATION.productDAO.getCategories()>
  <!--- Call the DAO for get featured products --->
  <cfset getfeaturedproducts = APPLICATION.productDAO.getfeaturedproducts()>
  <!---Call the DAO to retrieve products by form criteria  --->         
                <cfset getsearchproducts =
APPLICATION.productDAO.searchProducts(criteria=FORM.criteria)>
<!--- Insert this search into the database ---> 

<cfdump var="#form#">
<cfabort>
<cfset Application.productDAO.insertSearch(criteria = form.criteria,
searchreturncount = getsearchproducts.recordcount) />




Regards,
Andrew Scott
 
Quote of the Day:
In politics an absurdity is not a handicap. - Napoleon Bonaparte 

-----Original Message-----
From: Will Tomlinson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 13 December 2005 3:02 PM
To: CF-Talk
Subject: Re: What am I missin' here with this cfparam??

Yes, i'm back! The form itself is inside a cfc that outputs. I don't know
how that'd make a double insert happen though. I think the key is the
cfparam. Howcome when I remove the cfparam, one record is inserted as it
should be? Leave the cfparam in, 2 records insert. 

poof!



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226912
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to