This topic contains 4 replies, has 0 voices, and was last updated by matthewjiang 7 years, 10 months ago.
-
AuthorPosts
-
January 3, 2017 at 10:22 am #5641
matthewjiangHappy new year!
โHere is old issue from last year. =_=. In Suitelet page, the page navigation drop-down list does not work. How can I show all results on current page without using page navigation. My purpose is to make a custom search with searching fields and result on one page. I can use nlobjForm or nlobjList to generate a Suitelet page , but
โ1) With using nlobjForm , the page navigation does not work;
โ2) with using nlobjList , I can’t show search fields on the page.
3) Also, by using HTML, how to handle search fields, Can Netsuite respond html form?
Is there some way to handle this situation.
Thanks,
Matthew
Attached Files
This is a cached copy. Click here to see the original post. -
January 3, 2017 at 10:39 am #5642
pcutlerI’ve often handled my own pagination by using nlobSublist.addButton to add PREVIOUS PAGE and NEXT PAGE buttons. On click of those buttons, you can redirect to the URL with a parameter such as &page=2. Then when the suitelet runs again, it can use .getResults(x, y) to get the correct result set.
-
January 6, 2017 at 8:50 am #5643
matthewjiangSorry, I have not figure it out. My button didn’t go anywhere. It confused me how to use redirect URL correctly. Here is the code in my Suitelet script:
var currPage = request.getParameter(‘page’);
var itemName = request.getParameter(‘custpage_bsdi_item’);
var lotNo = request.getParameter(‘custpage_bsdi_lotnumber’);
…
var tempSearch = nlapiCreateSearch(recordId, filters1, columns1);
var tempSearchSet = tempSearch.runSearch();
var results1 = tempSearchSet.getResults(currPage * 25 – 24, currPage * 25);
…
var urlParams = {
custpage_bsdi_item : ”,
custpage_bsdi_lotnumber : ”,
page : currPage+1
}
var script = ‘nlapiSetRedirectURL(“SUITELET”, “customscript21”, “customdeploy1”, null, urlParams)’;
form.addButton(‘custombuttonnext’, ‘Next Page’, script);
…
form.addSubmitButton(‘SEARCH’);
response.writePage(form);
There should be something wrong. Please let me know.
Thanks a lot.
-
January 16, 2017 at 6:48 pm #5644
pcutlerHi Matt, it looks like your code confuses client and server script. For clarity, it may be easiest to create a separate client script that includes the client script methods including the button click function. Then, you can use form.setScript() to associate your client script with the Suitelet.
Also, I don’t believe that nlapiSetRedirectURL would be valid in this context. Since the client script runs within the browser, simply window.location = ‘google.com’ would trigger a redirect.
-
January 18, 2017 at 10:09 am #5645
matthewjiangThank you. It works.
-
AuthorPosts
You must be logged in to reply to this topic.