4 Replies Latest reply on Jun 9, 2009 12:55 PM by jeffcg2

    Flex Builder 3 cfc with Flash Builder

    jeffcg2 Level 1

      I have a number of .cfc that were generated with Flex Builder 3. I would think these would work with Flash Builder. Everything seems to be available but I must have missed something. I get a popup Primitive Type Returned - The operation returned a response of the type "Object". The screenshots should explain.

       

      What am I missing?

        • 1. Re: Flex Builder 3 cfc with Flash Builder
          jeffcg2 Level 1

          This screen shot shows what I am doing to configure the return type.

          • 2. Re: Flex Builder 3 cfc with Flash Builder
            Mayank (Adobe) Adobe Employee

            Hi,

             

            Can you please attach the cfc file you are using?

             

            thnx

            -mayank

            • 3. Re: Flex Builder 3 cfc with Flash Builder
              jeffcg2 Level 1

              Here it is

               

              <cfcomponent>
                  <cffunction name="getMasterQuery" output="false" access="remote" returntype="query">
                      <!--- <cfargument name="ID" required="false"> --->
                      <cfargument name="techid" default="" required="no">
                      <cfargument name="meter" default="" required="no">
                      <cfargument name="StartTime" default="#dateformat(now(), "mm/dd/yyyy")#" required="no">
                      <cfargument name="EndTime" default="" required="no">
                      <cfargument name="cust" default="">
                      <cfargument name="address" default="">
                      <cfargument name="select" default="">
                      <cfargument name="failed1" default="">
                      <cfargument name="failed2" default="">
                      <cfargument name="failed3" default="">
                      <cfargument name="apt" default="">
                      <cfargument name="troublecode" default="">
                      <cfset var qRead="">

               

                      <cfquery name="qRead" datasource="mydatabase">
                          SELECT  id, STARTTIME, METERNUMBER, CUSTOMER, ADDRESS
                          FROM      dbo.tablename
                          WHERE     0=0
                           <cfif arguments.meter is not ''>
                               and convert(varchar(10),meternumber) like <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.meter#%" />
                           </cfif>
                           <cfif #arguments.StartTime# IS NOT '' and #arguments.EndTime# is ''>
                               and convert(varchar(12),StartTime,101) = <cfqueryparam cfsqltype="cf_sql_date" value="#dateformat(arguments.StartTime, "mm/dd/yyyy")#" />
                           </cfif>
                           <cfif #arguments.StartTime# IS NOT '' and #arguments.EndTime# is not ''>
                               and StartTime between  <cfqueryparam cfsqltype="cf_sql_date" value="#dateformat(arguments.StartTime, "mm/dd/yyyy")#" /> and  <cfqueryparam cfsqltype="cf_sql_date" value="#dateformat(dateadd("d",1,arguments.endTime), "mm/dd/yyyy")#" />
                           </cfif>
                           <cfif #arguments.techid# is not ''>
                               and techid = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.techid#" />
                           </cfif>
                           <cfif #arguments.cust# is not ''>
                              and (customer like '%#cust#%')
                          </cfif>
                          <cfif #arguments.address# is not ''>
                              and (address like '%#address#%')
                          </cfif>
                          <cfif #arguments.select# is 'NEEDAPT'>
                              and ((NEWMETERNUMBER = '0') and (FAILEDATTEMPT <> ''))
                              or ((NEWMETERNUMBER = '') and (FAILEDATTEMPT <> ''))
                          <cfelseif #arguments.select# is 'HAVEAPT'>
                              and (apt > '')
                          <cfelseif #arguments.select# is 'TROUBLE'>
                              and (troublecode > '')
                          </cfif>
                          ORDER BY CUSTOMER
                      </cfquery>

               

                      <cfreturn qRead>
                  </cffunction>
                 
                  <cffunction name="getTech" output="no" access="remote" returntype="query">
                      <cfargument name="StartTime" default="" required="no">
                      <cfargument name="EndTime" default="" required="no">
                      <cfset var qTech="">
                      <cfquery name="qTech" datasource="mydatabase">
                          select techid
                          from dbo.tablename
                          where 0=0
                          <cfif #arguments.StartTime# IS NOT '' and #arguments.EndTime# is ''>
                              AND convert(varchar(12),StartTime,101) = <cfqueryparam cfsqltype="cf_sql_date" value="#dateformat(arguments.StartTime, "mm/dd/yyyy")#" />
                          </cfif>
                          <cfif #arguments.StartTime# IS NOT '' and #arguments.EndTime# is not ''>
                              AND StartTime between  <cfqueryparam cfsqltype="cf_sql_date" value="#dateformat(arguments.StartTime, "mm/dd/yyyy")#" /> and  <cfqueryparam cfsqltype="cf_sql_date" value="#dateformat(dateadd("d",1,arguments.endTime), "mm/dd/yyyy")#" />
                          </cfif>
                          group by techid
                          order by techid
                      </cfquery>
                      <cfreturn qTech>
                  </cffunction>

               

                  <cffunction name="deleteItem" output="false" access="remote" returntype="void">
                      <cfargument name="ID" required="true">

               

                      <cfscript>
                          var TABLEGateway = createObject("component", "admin.components.cfgenerated.TABLE.TABLEGateway");
                          TABLEGateway.deleteByID(arguments.ID);
                      </cfscript>
                  </cffunction>
              </cfcomponent>

              • 4. Re: Flex Builder 3 cfc with Flash Builder
                jeffcg2 Level 1

                Update:

                I used the Configure Coldfusion Service with a new Service Name > Generate sample CFC I entered the basic select query from the cfc that was not working and it worked. I then went back to start seeing what was different. Low and behold the one that was not working now works.

                 

                I don't know why?