我将Adempiere与Magento同步产品集成,我想创建一个自定义选项,但我得到错误
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 (?, ?, ?, ?)
我已经给出了值Product_DATA.put(" price_type"," percent");代码:
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();
}
答案 0 :(得分:0)
尝试使用(String)强制转换,或使用字符串valueof