Skip to main content
nikos101
Inspiring
August 10, 2011
Answered

Complex object types cannot be converted to simple values with a good path

  • August 10, 2011
  • 1 reply
  • 1738 views

   hi there 🙂

<cffile action='Write' file="#filename#" output='#data#' >

works fine with


<cfset filename = "\\fs-shared\shared$\biz\pre\#DateFormat(now(), "dd mmm yyyy hh mm ss")#.xml">

but with this

    <cfset filename = "c:\#DateFormat(now(), "dd mmm yyyy hh mm ss")#.xml">

I get this:


faultCode:Server.Processing  faultString:'Unable to invoke CFC - Complex object types cannot be  converted to simple values.' faultDetail:'The expression has requested a  variable or an intermediate expression result as a simple value.  However, the result cannot be converted to a simple value. Simple values  are strings, numbers, boolean values, and date/time values. Queries,  arrays, and COM objects are examples of complex values. <p> The  most likely cause of the error is that you tried to use a complex value  as a simple one. For example, you tried to use a query variable in a  cfif tag.'

    This topic has been closed for replies.
    Correct answer Dan_Bracuk

    When I do this:

    <cfset filename = "c:\#DateFormat(now(), "dd mmm yyyy hh mm ss")#.xml">
    <cfdump var="#filename#">

    I get this:

    c:\10 Aug 2011 10 08 41.xml

    Maybe the problem is with the data variable.

    1 reply

    Dan_BracukCorrect answer
    Inspiring
    August 10, 2011

    When I do this:

    <cfset filename = "c:\#DateFormat(now(), "dd mmm yyyy hh mm ss")#.xml">
    <cfdump var="#filename#">

    I get this:

    c:\10 Aug 2011 10 08 41.xml

    Maybe the problem is with the data variable.

    nikos101
    nikos101Author
    Inspiring
    August 10, 2011

    yeah it was )