我正在尝试更新销售订单中每个订单项的数量,但我遇到了问题。我有下面的代码,但它没有更新项目。
private bool FullFillThisItem(string lineID,int qty)
{
ItemFulfillmentItem item = new ItemFulfillmentItem();
item.orderLineSpecified = true;
item.orderLine = lineID;
item.quantity = qty;
item.quantitySpecified = true;
WriteResponse ws = _service.add(item);
if (ws.status.success)
label1.text =@"Ok... something happened!";
else
label1.text = "Oh boy...";
};
目前,当我运行上面的代码时,我得到了成功案例;但是当我通过" web gui"并查看记录,它没有更新。如果我通过" web gui"更新数量它正确更新。 :(
如果有人可以伸出援手,我会爱上它。 这是我的第一篇文章,所以希望我做得对。 :)
答案 0 :(得分:0)
您发布的代码无法编译。 NetSuiteService.add()
需要Record
个对象,而您已经传递了ItemFulfillmentItem
个对象。
以下代码适用于我。
ItemFulfillment itemFulfillment = new ItemFulfillment()
{
createdFrom = new RecordRef() { type = RecordType.salesOrder, internalId = "7795181" },
itemList = new ItemFulfillmentItemList()
{
replaceAll = false,
item = new ItemFulfillmentItem[]
{
new ItemFulfillmentItem()
{
orderLine = 1,
orderLineSpecified = true,
quantity = 1,
quantitySpecified = true,
},
}
},
};