1 Reply Latest reply on Dec 10, 2007 10:07 AM by kausi21

    Flex Project Help

    kausi21
      Ok on my flex app I have a place where they create a new client with session's, and each client has the ability to buy different add ons. I'm using a repeater to pull the add ons from the database then when checked, and submitted it will Insert the information back to the database. What I have, so far is when you click the submit button I get no errors, but it doesn't submit anything. My <cfmail looks like this.

      INSERT INTO
      glb_order_details
      (sessions,order_id,hosting_notification,product_id)
      SELECT '1',407,1, id
      FROM glb_products
      WHERE id IN(0)

      As you can see I'm trying to pull the product id from glb_products, but its choking on that. Here is my cfc query.

      <cffunction name="NewSessionTotal" access="remote" returntype="void">
      <cfargument name="sessions" default="" type="String" required="no">
      <cfargument name="order_id" default="" required="no">
      <cfargument name="hosting" default="" required="no">
      <cfargument name="product_idlist" default="" required="no">
      <cfquery name="SessionTotal" datasource="omnitrac">
      INSERT INTO
      glb_order_details
      (sessions,order_id,hosting_notification,product_id)
      SELECT '#arguments.sessions#',#arguments.order_id#,#IIF(arguments.hosting,DE("1"),DE("0"))#, id
      FROM glb_products
      WHERE id IN(#ListAppend(arguments.product_idlist,0)#)
      </cfquery>
      </cffunction>

      And here is my flex app code.

      var SelectedSalesProducts:Array=new Array();
      var SelectedSalesProductslist:String="";
      for (var i:int = 0; i < gsalesproducts.length; i++){
      if(fff0 .selected){
      SelectedSalesProducts.push(r0.dataProvider.getItemAt(i).id);
      }
      }
      this.dataManager.NewSessionTotal(this.nsessiontotal.text,order_id,hosting.selected,Select edSalesProductslist);
      }

      I know its the product_id code that cause everything to choke up, but I been working on this for 4 days and cannot find a solutions. Any help would be great.
        • 1. Re: Flex Project Help
          kausi21 Level 1
          I found what was wrong. Here, is the fix :) in the flex app I needed to add this line

          SelectedSalesProductslist=SelectedSalesProducts.join(",");

          I forgot to join my string, and array. Also the biggest thing I missed was on this line

          SelectedSalesProducts.push(r0.dataProvider.getItemAt(i).id);

          Instead of id it actually needed to be product_id