This topic contains 2 replies, has 0 voices, and was last updated by JohnCCole 6 years, 9 months ago.

  • Author
    Posts
  • #17812

    timgordon

    We are using Advance Shipping with Pick, Pack, Ship enabled. Right now I am writing some scheduled scripts for integrating Netsuite with our 3PL warehousing service. These scripts need to be in Suitescript 2.0. I have some of my solution working already e.g. running a saved search and compiling a data file and transmitting to a SFTP server. Next I need to do some work with updating Fulfillments.

    I would really appreciate it if anyone is able to share code snippets for and of the following scenarios:

    Update a Fulfillment recordchange the Status e.g. to Shipped
    Add a row to the Package list on the Fulfillment i.e. with description, tracking number, weight
    Update a custom field
    This is a cached copy. Click here to see the original post.

  • #17813

    timgordon

    Anyone done this before? I would really appreciate a code snippet for working with Fulfillments, thank you in advance.

  • #17814

    JohnCCole

    Code:
    var itemFulfill = record.load({type:record.Type.ITEM_FULFILLMENT,id:’internalidoffulfillmentrec’});
    // Set a custom field
    itemFulfill.setValue({fieldId:’Some custom field’,value:’Some Value’});
    // Set status to shipped
    itemFulfill.setValue({fieldId:’status’,value:’ItemShip:C’});
    // Add a new line item to package sublist
    itemFulfill.selectNewLine({sublistId:’package’});
    itemFulfill.setCurrentSublistValue({sublistId:’package’,fieldId:’packageweight’,value:weight});
    itemFulfill.setCurrentSublistValue({sublistId:’package’,fieldId:’packagetrackingnumber’,value:trackingNumber});
    // Commit Line
    itemFulfill.commitLine({sublistId:’package’});

    itemFulfill.save({
    enableSourcing: true,
    ignoreMandatoryFields: true
    });

You must be logged in to reply to this topic.