C# - Netsuite履行销售订单项目?

时间:2018-01-09 21:45:58

标签: c# netsuite

我正在尝试更新销售订单中每个订单项的数量,但我遇到了问题。我有下面的代码,但它没有更新项目。

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"更新数量它正确更新。 :(

如果有人可以伸出援手,我会爱上它。 这是我的第一篇文章,所以希望我做得对。 :)

1 个答案:

答案 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,
            },
        }
    },
};