Add new comment

Ok, got it figured out!!! It has to do with how "Shipping Items" are setup and whether the Shipping Item is integrated with the UPS. Uncheck the "Shipping Lael Integration" on the Shipping Item screen.

Then, the UPS Real-Time Rate / Flat Rate / Weight information has to be configured correctly, and depending on the setup you'll have supply the required list items through the API. Here is a modified script.

var filters = new Array();
filters[0] = new nlobjSearchFilter('tranId', null, 'is', '123');
var searchresults = nlapiSearchRecord( 'salesorder', null, filters, null );
if (searchresults != null && searchresults != '') {
    var orderId = searchresults[0].getId();
    var iff = nlapiTransformRecord('salesorder', orderId, 'itemfulfillment');
    iff.setFieldValue('shipmethod', '5'); // Some shipping method not integrated with UPS.
    iff.setLineItemValue('item','shipmethod',1,'5');  // Same Shipping method as Sales Order
    iff.setLineItemValue('package','packageweight',1, '1');  // If shipping cost is weight based.
    iff.setLineItemValue('package','packagetrackingnumber',1,'1Z0000000000000000');
    nlapiSubmitRecord(iff, true);
}

It should be noted that the Record Sublist is assigned with setLineItemValue() method as shown on the lines, 8 - 10.

By aladar

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.