Skip to main content
Participant
July 16, 2012
Answered

cfinvoke argument missing??

  • July 16, 2012
  • 1 reply
  • 649 views

Hello,

I'm having problem with method invocation. I have the following at the top of my function:

<cfobject component="cfc.main" name="mainCFCObj">

And later on in the code I do invocations as follows:

<cfinvoke component="#mainCFCObj#" method="GetEntriesBySection" returnvariable="sectionData" tableSection="C.1">


I do the above several times (for different methods and arguments) and it works fine until one invocation:

<cfinvoke component="#mainCFCObj#" method="GetAjaxRecordCountForUser" returnvariable="myAjaxRecordCount" username="some_user">


Coldfusion 10 gives me the following error:

The USERNAME parameter to the GetAjaxRecordCountForUser function is required but was not passed in.

Does anyone have any idea about this?? Thank you.

This topic has been closed for replies.
Correct answer mikhairu

Solved.

Looking through the documentation for cfinvoke I realized that username is one of the optional attributes of the cfinvoke tag. So changing username variable name to something else did the trick.

Also, <cfinvokeargument name="username" value="some_user"> inside the <cfinvoke></cfinvoke> works as well, since here username is an argument to a method and not an attribute of the tag  like before.

Thank you everybody.

1 reply

mikhairuAuthorCorrect answer
Participant
July 16, 2012

Solved.

Looking through the documentation for cfinvoke I realized that username is one of the optional attributes of the cfinvoke tag. So changing username variable name to something else did the trick.

Also, <cfinvokeargument name="username" value="some_user"> inside the <cfinvoke></cfinvoke> works as well, since here username is an argument to a method and not an attribute of the tag  like before.

Thank you everybody.