I have created a suitelet that is forwarded from a record in which I pass some parameters in the url. I then proceed to dynamically build a sublist on the form by calling the request.getParameter() method. So the list's contents are sourced by using the value of the parameter passed in the url. On load the sublist is populated with the data as expected.
Now, whenever I try to manipulate the sublist, for example if it has more than 25 results, and I use the dropdown, the sublist refreshes, the getparameter method is called a 2nd time, but the script breaks when it attempts to get the url parameter.
Some psuedocode, since the actual code is quite lengthy:
Script to foward from record to suitelet
var linkURL = nlapiResolveURL(); form.addButton('custpage_mycustpageid', 'Vendor Report', "document.location='" + linkURL + "&param1=" + param1 + "&recipients=" + recipients + "'"); Script to build form and sublist if (request.getMethod() == 'GET') { var form = nlapiCreateForm(); var sublist = form.addSublist(); var sublistresults = getSublist(request.getParameter('param1')); sublist.setLineItemValues(sublistresults); response.writePage(form); } else //do stuff on POST Is there something incorrect with my logic? The script is able to request the parameter on the initial loading of the page, but not when an action on the sublist refreshes the page.