Sunday, March 28, 2010

Cffunction error

The argument TEAM passed to function SearchRes() is not of type numeric.

If the component name is specified as a type of this argument, the reason for this error might be that a definition file for such component cannot be found or is not accessible.
The error occurred in C:\Inetpub\wwwroot\search.cfc: line 4
2 : 
3 : %26lt;cffunction name=''SearchRes'' access=''public'' returntype=''query''%26gt;
4 : %26lt;cfargument name=''DSN'' type=''string'' required=''yes''%26gt;
5 : %26lt;cfargument name=''Role'' type=''string'' required=''no''%26gt;
6 : %26lt;cfargument name=''Team'' type=''numeric'' required=''no''%26gt;

Please look at the above error...any help app...

code -------------------------%26gt;

%26lt;cfcomponent hint=''This cfc does search...''%26gt;

%26lt;cffunction name=''SearchRes'' access=''public'' returntype=''query''%26gt;
%26lt;cfargument name=''DSN'' type=''string'' required=''yes''%26gt;
?%26lt;cfargument name=''Role'' type=''string'' required=''no''%26gt;
?%26lt;cfargument name=''Team'' type=''numeric'' required=''no''%26gt;
?%26lt;cfargument name=''Level'' type=''numeric'' required=''no''%26gt;
?
?%26lt;cfargument name=''zone'' type=''numeric'' required=''no''%26gt;
?%26lt;cfargument name=''Dept'' type=''numeric'' required=''no''%26gt;
?%26lt;cfargument name=''location'' type=''numeric'' required=''no''%26gt;
?
?%26lt;cfargument name=''csgid'' type=''string'' required=''no''%26gt;
?%26lt;cfargument name=''status'' type=''string'' required=''no''%26gt;
?%26lt;cfargument name=''filter'' type=''string'' required=''no''%26gt;
?%26lt;cfargument name=''bosseid'' type=''string'' required=''no''%26gt;
%26lt;cfdump var=''#arguments#''%26gt;
?%26lt;cfquery datasource=''#arguments.DSN#'' name=''SearchRes''%26gt;
?Select
?r.First_name,
?r.Last_name,
?r.EID,
?r.tech_id,
?r.title,
?r.hire_date,
?r.rehire_date,
?l.location,
?d.department
?from
?OPS$RMS.REF_resource r,
?OPS$RMS.Ref_department d,
?OPS$RMS.REF_Location l
?where
?r.location_code = l.location_code
?And r.department_code = d.department_code
?
?%26lt;cfif arguments.role neq ''''%26gt;
And r.role_code = '#arguments.role#'
?%26lt;/cfif%26gt;
?%26lt;cfif arguments.Team neq ''''%26gt;
And r.team_code = #arguments.team#
?%26lt;/cfif%26gt;
?%26lt;cfif arguments.level neq ''''%26gt;
And r.level_code = #arguments.level#
?%26lt;/cfif%26gt;
?%26lt;cfif arguments.zone neq ''''%26gt;
--And r.zone_code = #arguments.zone#
?%26lt;/cfif%26gt;
?
?%26lt;cfif arguments.dept neq ''''%26gt;
And r.department_code = #arguments.dept#
?%26lt;/cfif%26gt;
?%26lt;cfif arguments.location neq ''''%26gt;
And r.location_code = #arguments.location#
?%26lt;/cfif%26gt;
?%26lt;cfif arguments.csgid neq ''''%26gt;
And r.csg_operator_id like '#arguments.csgid#%'
?%26lt;/cfif%26gt;
?%26lt;cfif arguments.status neq ''''%26gt;
And r.status = '#arguments.status#'
?%26lt;/cfif%26gt;
?%26lt;cfif arguments.filter neq ''''%26gt;
?And
?(
?r.EID = '#arguments.filter#%'
?OR r.First_name like '#arguments.filter#%'
?OR r.last_name like '#arguments.filter#%'
?OR r.tech_id like '#arguments.filter#%'
?)
?%26lt;/cfif%26gt;
?%26lt;cfif arguments.bosseid neq ''''%26gt;
And r.boss_id = '#arguments.bosseid#%'
?%26lt;/cfif%26gt;
?
?%26lt;/cfquery%26gt;
?%26lt;cfreturn SearchRes%26gt;
%26lt;/cffunction%26gt;

%26lt;/cfcomponent%26gt;

Cffunction error

emmim44 wrote:


The argument TEAM passed to function SearchRes() is not of type numeric.
Cffunction error

I checked it is... these fields are coming from a search page... all of them can be null....or any of them

Can you show the code where you call the function? Are you passing the arguments in as an argument collection or individually?

Might not be an issue but, while your Team variable can be null, the cfargument tag types the variable as a numeric value (as opposed to any or whatever). Depending on what you're supplying this could be a source of the error.

you would have to do some validation [and/or typing] on the variable before you pass it to the function. basically, make sure it is a number before you pass it on.

craigkaminsky wrote:

Might not be an issue but, while your Team variable can be null, the cfargument tag types the variable as a numeric value (as opposed to any or whatever). Depending on what you're supplying this could be a source of the error.

No comments:

Post a Comment