使用SuiteTalk发送ItemFulfillment时遇到麻烦

本文关键字:遇到 麻烦 ItemFulfillment SuiteTalk 发送 使用 | 更新日期: 2023-09-27 18:17:16

我需要做些什么来标记ItemFulfillment作为发货,包括包装信息和可能使用SuiteTalk的不同运输方法/承运人?我们使用WMS Lite RF Mobile Screen最初创建ItemFulfillment,然后自定义应用程序来发布它。

我最初尝试使用ItemFulfillmentPackageList来指定包,但它似乎忽略了我指定的内容,并添加了一个默认包(0.05 lb,没有描述或跟踪)。

然后我尝试ItemFulfillmentPackageUspsList等,如果与订单和履行记录中先前指定的承运人匹配,则出现正确的包装信息。如果不匹配,就会得到一个错误"[Code=JS_EXCEPTION] error:将运输方法切换到另一个承运人是不受支持的操作,因为它需要重新加载该承运人的物品履行表单。"我们需要切换运营商的能力,因为我们为一些订单提供免费送货,这最终导致"从主要的3家运营商提供的价格中为套餐选择最便宜的价格"。

//curShipment is an EasyPost shipment after purchasing postage.
//it contains relevant information about the package
ItemFulfillment fulfillmentUpdate = new ItemFulfillment();
fulfillmentUpdate.internalId = curFulfillment.internalId;
fulfillmentUpdate.shipStatus = ItemFulfillmentShipStatus._shipped;
fulfillmentUpdate.shipStatusSpecified = true;
fulfillmentUpdate.shipMethod = new RecordRef()
{
    // Get the internalId from a saved dictionary
    internalId = shipMethods.GetNetsuite(curShipment.selected_rate).netsuiteId
};
switch (curShipment.selected_rate.carrier)
{
    case "USPS":
        ItemFulfillmentPackageUsps pkgUsps = new ItemFulfillmentPackageUsps();
        pkgUsps.packageWeightUsps = curShipment.parcel.weight / 16; // Easypost uses Oz, Netsuite uses Lb
        pkgUsps.packageWeightUspsSpecified = true;
        if (string.IsNullOrWhiteSpace(curShipment.parcel.predefined_package))
        {
            pkgUsps.packageLengthUsps = (long)curShipment.parcel.length;
            pkgUsps.packageLengthUspsSpecified = true;
            pkgUsps.packageWidthUsps = (long)curShipment.parcel.width;
            pkgUsps.packageWidthUspsSpecified = true;
            pkgUsps.packageHeightUsps = (long)curShipment.parcel.height;
        }
        pkgUsps.packageTrackingNumberUsps = curShipment.tracking_code;
        ItemFulfillmentPackageUspsList pkgListUsps = new ItemFulfillmentPackageUspsList();
        pkgListUsps.packageUsps = new ItemFulfillmentPackageUsps[] { pkgUsps };
        fulfillmentUpdate.packageUspsList = pkgListUsps;
        break;
    // Cases for the other carriers, almost identical to USPS above
}
SetNetsuitePrefs(); // Sets preferences and authenticates, similar to the ERP example code
WriteResponse response = await System.Threading.Tasks.Task<SearchResult>.Run(() => { return nsService.update(fulfillmentUpdate); });
// Results in error:
// [Code=JS_EXCEPTION] Error: Switching the shipping method to another carrier is an unsupported operation, because it requires reloading the item fulfillment form for that carrier.

使用SuiteTalk发送ItemFulfillment时遇到麻烦

尝试将shipMethod设置为您将使用的Shipping Item的RecordRef。如果SO与FedEx Shipping Item一起输入,现在您想使用UPS,那么相应地设置shipMethod并使用特定于运营商的包裹列表结构。