On Fri, 12 Nov 2004 10:48:47 -0500, Brent Nicholas <[EMAIL PROTECTED]> wrote: > Ok, so I've run into this from time to time and I can never seem to really > figure it out. > > I'm not passing WorkFlowCode param in and I shouldn't need to but it errors > out. Something obvious I'm overlooking? > > It throws up on: <cfif ARGUMENTS.WorkFlowCode neq ""> > > Code: > > <!--- GetAuditWorkflow ---> > <cffunction name="GetAuditWorkflow" access="public" returntype="query" > output="No" displayname="Get workflow action id's and people for audit." > hint="Get workflow action id's and people for audit and workflow type."> > > <cfargument name="DATASOURCE" type="string" required="Yes" default=""> > <cfargument name="IawpAuditSeq" required="Yes" type="string"> > <cfargument name="WorkFlowCode" required="No" default="" > type="string"> > > <cfquery name="GetAuditWorkflow" datasource="#ARGUMENTS.datasource#"> > SELECT PERSON_ID > ,WORKFLOW_ACTION_ID > ,CREATED_BY > FROM IAWP_WORKFLOW > WHERE IAWP_AUDIT_SEQ = '#ARGUMENTS.IawpAuditSeq#' > > <cfif ARGUMENTS.WorkFlowCode neq ""> > AND WORKFLOW_CODE = '#ARGUMENTS.WorkFlowCode#' > </cfif> > > </cfquery> > > <cfreturn GetAuditWorkflow> > </cffunction> >
Brent, Your problem is that you say "datasource" is required, yet you give a default value of a blank string -- you can't do that. If you set required="yes", you *cannot* use the default attribute -- they are mutually exclusive and having a "default" attribute implicitly makes the argument optional. Your error is misleading because it's really the datasource value that's empty. I've seen this one a bunch of times before. Regards, Dave. ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at [EMAIL PROTECTED]
