0 Replies Latest reply on Aug 1, 2011 10:21 AM by jeffcg2

    Coldfusion generated dataservices don't work for insert or update.

    jeffcg2 Level 1

      What is supposed to go in "/* Enter value(s) for*/" item below.

       

      Is this code generated assuming it is working with LCDS or BlaseDS??

       

      There has got to be something else that needs to be done to make this work. But I have not been able to find out what that is supposed to be.

       

       

      protected

       

       

      function button2_clickHandler(event:MouseEvent):

      void

      {

      updateitron_rmasResult.token = itron_rmasService.updateitron_rmas(

      /*Enter value(s) for */ item);

      }

      ____________________________________________________

      Flex function.

       

      protected

       

       

      function button_clickHandler(event:MouseEvent):

      void

      {

      itron_rmas.id = parseFloat(idTextInput.text);

      itron_rmas.rma = rmaTextInput.text;

      itron_rmas.sentdate = sentdateDateField.selectedDate;

      itron_rmas.closeddate = closeddateDateField.selectedDate;

      itron_rmas.quotedate = quotedateDateField.selectedDate;

      itron_rmas.so = soTextInput.text;

      itron_rmas.customerid = parseFloat(customeridTextInput.text);

      itron_rmas.Customer = customerTextInput.text;

      itron_rmas.Qty = parseFloat(qtyTextInput.text);

      itron_rmas.Notes = notesTextInput.text;

      itron_rmas.estimatecost = parseFloat(estimatecostTextInput.text);

      itron_rmas.estimatesell = parseFloat(estimatesellTextInput.text);

      itron_rmas.hdpo = hdpoTextInput.text;

      itron_rmas.serialnumber = serialnumberTextInput.text;

      itron_rmas.description = descriptionTextInput.text;

      itron_rmas.product = productTextInput.text;

      itron_rmas.custpo = custpoTextInput.text;

      itron_rmas.writtenby = writtenbyTextInput.text;

      updateitron_rmasResult.token = itron_rmasService.updateitron_rmas(

      this.itron_rmas);

      }

       

      ___________________________________________

      Coldfusion Function

       

      <cffunction

       

       

       

      name="updateitron_customers" output="false" access="remote" returntype="void" >

       

       

       

      <cfargument name="item" required="true" />

       

        

       

       

       

      <cfquery name="updateItem" datasource="mydb">

       

       

       

      UPDATE itron_customers SET customer = <CFQUERYPARAM cfsqltype=CF_SQL_VARCHAR VALUE="#item.customer#">,

      city =

      <CFQUERYPARAM cfsqltype=CF_SQL_VARCHAR VALUE="#item.city#">,

      state =

      <CFQUERYPARAM cfsqltype=CF_SQL_VARCHAR VALUE="#item.state#">,

      contact =

      <CFQUERYPARAM cfsqltype=CF_SQL_VARCHAR VALUE="#item.contact#">,

      notes =

      <CFQUERYPARAM cfsqltype=CF_SQL_VARCHAR VALUE="#item.notes#">,

      phone =

      <CFQUERYPARAM cfsqltype=CF_SQL_VARCHAR VALUE="#item.phone#">,

      fax =

      <CFQUERYPARAM cfsqltype=CF_SQL_VARCHAR VALUE="#item.fax#">,

      email =

      <CFQUERYPARAM cfsqltype=CF_SQL_VARCHAR VALUE="#item.email#">

       

       

       

       

      WHERE id = <CFQUERYPARAM CFSQLTYPE="CF_SQL_INTEGER" VALUE="#item.id#">

       

       

       

      </cfquery>

       

       

       

       

      </cffunction>