我需要做些什么来标记已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.