Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFC Error -pass parameters

Participant ,
Oct 06, 2008 Oct 06, 2008
Can anyone point out a solution this error? Thank you in advance...the BossEID is not blank...

The parameter CCFBOSSEID to function update is required but was not passed in.


The error occurred in C:\Inetpub\wwwroot\Scorecard33\admin\ccf\bridge\act_csv.import.cfm: line 82
Called from C:\Inetpub\wwwroot\Scorecard33\parsed\bridge.csv.cfm: line 30
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\Application.cfc: line 228
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\Application.cfc: line 218
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\fusebox5.cfm: line 57
Called from C:\Inetpub\wwwroot\Scorecard33\index.cfm: line 3

80 : <cfset MyCSV.update(EID, ccfLevel, CCFRole, CCFTeamID,CCFlocationID, status,
81 : CSGID, SalesRep_id, Peoplesoftid, AvayaID,
82 : first_name, mi, last_name, hiredate, CCFBossEID)>
83 : <cfelse>
84 : <li>Adding...</li>


714
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 06, 2008 Oct 06, 2008
If you are convinced that it's not blank, make sure that you have an exact match between the variables you are sending to your function and the cfargument tags. I notice one of them was commented out.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 06, 2008 Oct 06, 2008
Lets say if some of the CCFBossEID are blank, what do you suggest then?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 06, 2008 Oct 06, 2008
Always put any arguments that aren't required as the last arguments in your <cffunction>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 06, 2008 Oct 06, 2008
quote:

Originally posted by: emmim44
Lets say if some of the CCFBossEID are blank, what do you suggest then?

What do your business rules say about that?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 06, 2008 Oct 06, 2008
Are the order of cfarguments important when sending the parameters to the function?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 06, 2008 Oct 06, 2008
quote:

Originally posted by: emmim44
Are the order of cfarguments important when sending the parameters to the function?

Only when you use the method you attempted.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 06, 2008 Oct 06, 2008
How else do you think Coldfusion matches up what you're passing in?

When you call it using <cfinvoke...>, you explicitly tell CF which argument each parameter applies to in your <cfinvokeargument...> tags. When you call it as you do, using a comma-delimited list of variables, the only thing CF has to go on is the order of the parameters you're passing in, and the order of the arguments defined in the function.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 06, 2008 Oct 06, 2008
They said leave it null or blank... depends on db ...

Also, even I set a default value for status, how come 'Work_status' is not being updated with the default value = 'FTE' ??

<cfargument name="status" type="string" required="false" default="FTE">

<cfif arguments.status NEQ "">
Work_status = <cfqueryparam cfsqltype="CF_SQL_CHAR" value="#arguments.status#">,
<cfelse>
Work_status = '#arguments.status#',
</cfif>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 06, 2008 Oct 06, 2008
Because the default value is only used if status isn't being passed into the function. If it's being passed in, even if it's null or an empty string, the function is going to use what you passed in.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 06, 2008 Oct 06, 2008
quote:

Originally posted by: emmim44
They said leave it null or blank... depends on db ...

Also, even I set a default value for status, how come 'Work_status' is not being updated with the default value = 'FTE' ??

<cfargument name="status" type="string" required="false" default="FTE">

<cfif arguments.status NEQ "">
Work_status = <cfqueryparam cfsqltype="CF_SQL_CHAR" value="#arguments.status#">,
<cfelse>
Work_status = '#arguments.status#',
</cfif>

Kronin555's earlier reply explains it.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 06, 2008 Oct 06, 2008
LATEST
You are right man...Thank you guys...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources