0

I'm integrating Adempiere with Magento Synchronizing Products , i want to create a custom options but im getting error

XML-RPC Error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'price_type' cannot be null, query was: INSERT INTO `catalog_product_option_type_price` (`option_type_id`, `store_id`, `price`, `price_type`) VALUES (?, ?, ?, ?)

i have given the value Product_DATA.put("price_type", "percent"); code:

 public int CreateCustomOptions(String sessionid,Integer product_id,String Option,String o_value , String o_sku, String price)
 {   
        HashMap Product_DATA = new HashMap();
        Product_DATA.put("title", o_value);     
        Product_DATA.put("price",price);
        Product_DATA.put("price_type", "percent");
        Product_DATA.put("sku", o_sku); 

        Vector ARGS = new Vector();
        ARGS.add(sessionid);
        ARGS.add(new String ("product_custom_option_value.add"));
        ARGS.add(new Object[] {110,Product_DATA});      
        this.newRequest(remoteHost, "", sessionid, "call", ARGS);             
         Object RESULT = (Object) this.sendRequest(); 
}
Silviaa
  • 475
  • 8
  • 35

1 Answers1

0

Try to use (String) cast to force , or use string valueof

http://www.tutorialspoint.com/java/java_string_valueof.htm

Arthur Melo
  • 454
  • 5
  • 13