Copy link to clipboard
Copied
Im calling a remote object like so to the server
private function addMarginOrRefund(event:MarginCall_or_Refund_Event):void
{
myService.addMarginOrRefund(event.data);// cf calls a sp
}
CF
<cffunction name="addMarginOrRefund" access="remote" returntype="void">
<cfargument name="data" type="Any" required="yes">
<cfquery name="q" datasource="#datasource#">
INSERT INTO [tb_MarginCall_or_refund]
([clientID]
,[dealerID]
,[isMarginCall]
,[currency]
,[amount]
,[dateRequested])
VALUES
(
<cfqueryparam value="#arguments.data.clientID#" cfsqltype="cf_sql_integer">,
<cfqueryparam value="#arguments.data.clientID#" cfsqltype="cf_sql_integer">,
<cfqueryparam value="#arguments.data.isMarginCall#" cfsqltype="cf_sql_bit">,
<cfqueryparam value="#arguments.data.currency#" cfsqltype="cf_sql_varchar">,
<cfqueryparam value="#arguments.data.amount#" cfsqltype="cf_sql_numeric">,
<cfqueryparam value="#arguments.data.date#" cfsqltype="cf_sql_date">,
</cfquery>
</cffunction>
but I get an fault on the flex side
faultCode:Server.Processing faultString:'Unable to invoke CFC - The DATA parameter to the addMarginOrRefund function is required but was not passed in.' faultDetail:''
not sure why I should get this, any help would be appreciated
Copy link to clipboard
Copied
Are you sure the event data you are passing in is event:MarginCall_or_Refund_Event exists and isn't NULL?
Copy link to clipboard
Copied
everything looks fine in debug
event customevents.MarginCall_or_Refund_Event (@2b0e8581)
[inherited]
data models.MarginCall_or_Refund (@2b0e8511)
amount 2
clientID 1
currency "GBP"
date Date (@14f85a31)
dealerID 0
isMarginCall false
Copy link to clipboard
Copied
I think the problem is that cf doesn't know how to deal with the
MarginCall_or_Refund
type object, not sure how best to fix this
Copy link to clipboard
Copied
so strange I even treid this:
private function addMarginOrRefund(event:MarginCall_or_Refund_Event):void
{
//myService.addMarginOrRefund(event.data);// cf calls a sp
var it:Object = event.data;
myService.addMarginOrRefund(it);// cf calls a sp
}
I wathced in debug and everything seems fine. I've sent objects like this before in cf and I can't figure out whats different.
Copy link to clipboard
Copied
for some reason if I put an extra <cfargument before the object the whole thing works
private function addMarginOrRefund(event:MarginCall_or_Refund_Event):void
{
myService.addMarginOrRefund("fake",event.data);// cf calls a sp
}
<cffunction name="addMarginOrRefund" access="remote" returntype="void">
<cfargument name="fake" type="string" required="yes">
<cfargument name="data" type="Any" required="yes">
could be a CF9 bug?
Copy link to clipboard
Copied
This bug still exists in cf9 and fb4