0

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

我最初尝试使用 anItemFulfillmentPackageList来指定包裹,但它似乎忽略了我指定的内容并添加了默认包裹(0.05 磅,无描述或跟踪)。

然后我尝试ItemFulfillmentPackageUspsList了等,如果它与先前在订单和履行记录中指定的承运人匹配,则会出现正确的包裹信息。如果不匹配,我会收到错误“[Code=JS_EXCEPTION] 错误:将运输方式切换到另一个承运人是不受支持的操作,因为它需要重新加载该承运人的项目履行表单。” 我们需要切换运营商的能力,因为我们为某些订单提供免费送货服务,最终“从主要 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.
4

2 回答 2

0

每次运输都有不同的形式。您需要carrierform根据所选的运输方式进行设置。例如,我正在从一个销售订单创建一个项目履行,它具有shipcarrier = UPS

newTransaction.setValue({
    fieldId: 'carrierform',
    value: 'ups'
});
于 2022-02-07T13:42:51.590 回答
0

尝试shipMethod为您将使用的运输项目设置 RecordRef。如果 SO 是与 FedEx 运输项目一起输入的,并且现在您想使用 UPS,则进行shipMethod相应设置并使用特定于承运人的包裹列表结构。

于 2016-11-13T05:33:17.557 回答