Home » E-Commerce with NetSuite » Use the Shipping Item List as a Select Option in a Suitelet

Use the Shipping Item List as a Select Option in a Suitelet

Following is the tutorial taken from SuiteAnswers which shows how to create a select field having Shipping Items/Shipping Methods in Suitelet:

Use the Shipping Item List as a Select Option in a Suitelet

  1. Create a custom record type

    • Navigate to Customization > Lists, Records, & Fields > Record Types > New
    • Set the name – Shipping List
    • Set the ID – _rec_ship_list
    • Access type = no Permission Required
    • Save
  2. Add a custom field that will source the Shipping Item List

    • Edit the Record created from Part A.
    • Click on new field
    • Set the name – shipping item list
    • Set the ID – _shipping_list  
    • Type = List/Record
    • List/Record = Shipping Method
    • Save
  3. Create a new Record (Shipping List)

    • Open the custom record (Shipping List)
    • Click on View Records
    • Click on new
    • Set a Name to the record and Save
    • Take note of the Internal Id for this new record.
This Custom record will be used to access the shipping items.
 
Suitelet Script that will show a field with the shipping items as the select options.
 
Script:
function demoSimpleForm(request, response) {
    if (request.getMethod() == 'GET') {
        var form = nlapiCreateForm('Simple Form');
        var cusRec = nlapiLoadRecord('customrecord_rec_ship_list', 1);
        var shipFld = cusRec.getField('custrecord_shipping_list');
        var options = shipFld.getSelectOptions();
        var select = form.addField('custpage_selectfield', 'select', 'My Custom shipping item');
        select.addSelectOption('', '');
        for (var i = 0; i < options.length; i++) {
            select.addSelectOption(options[i].id, options[i].text);
        }
        form.addSubmitButton('Submit');
        response.writePage(form);
    } else {
        dumpResponse(request, response);
    }
}
 
This way we can fetch saved search’s name which is impossible by making/invoking saved search on saved search in SuiteScripts.
CTA - NetSuite Real Estate Solution Banner
CTA - NetSuite Shopify Connector Banner
SuiteAnswer Id: 32174
We are NetSuite Official Partner, specialized in NetSuite Implementation, Customization and all sort of integrations. Feel free to Contact Us for any query, or to request a quotation.

Get In Touch With Our Experts


    Get In Touch With Our Experts

      I have read and agree to the Privacy Policy of Folio3
      I agree to be contacted by Phone or Email by Folio3

      Get in touch with the

      Award-Winning

      End-to-end NetSuite Servicing Agency

      Tell us how may we assist you!