Title
#suitescript
al3xicon

al3xicon

12/14/2016, 6:32 PM
this is my suitelet:
/**
 * @NApiVersion 2.x
 * @NScriptType Suitelet
 * @NModuleScope SameAccount
 */
define(['N/http', 'N/ui/serverWidget'],

function(http, ui) {
   
    /**
     * Definition of the Suitelet script trigger point.
     *
     * @param {Object} context
     * @param {ServerRequest} context.request - Encapsulation of the incoming request
     * @param {ServerResponse} context.response - Encapsulation of the Suitelet response
     * @Since 2015.2
     */
    function onRequest(context) {
    	if (context.request.method == http.Method.GET) {
    		var form = ui.createForm({
    			title: 'Print Ship Check Picking Tickets by Vendor',
    			hideNavBar: true
    		});
    		form.clientScriptModulePath = 'SuiteScripts/KegWorks 2.0/KW_PrintShipCheckOrdersClient.js';
    		//form.clientScriptFileId = '1737081';
    		
    		var vendor = form.addField({
    			id: 'vendor', 
    			type: ui.FieldType.INLINEHTML, 
    			label: 'Vendor'
    		});
    		var vendor_html = '<span class="uir-label"><label class="smallgraytext" id="vendor_label">Vendor</label></span><select onchange="javascript:dostuff();" name="vendor" id="vendor">'+
    			'<option value="">Select a vendor...</option>'+
    			'<option value="22728">33 Books Co.</option>'+
    		'</select>';
    		vendor.defaultValue = vendor_html;
    		
    		context.response.writePage({
    			pageObject: form
    		});
    	}
    }

    return {
        onRequest: onRequest
    };
    
});