This topic contains 4 replies, has 0 voices, and was last updated by matthewjiang 7 years, 10 months ago.

  • Author
    Posts
  • #5641

    matthewjiang

    Happy 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.

  • #5642

    pcutler

    I’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.

  • #5643

    matthewjiang

    Sorry, 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.

  • #5644

    pcutler

    Hi 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.

  • #5645

    matthewjiang

    Thank you. It works.

You must be logged in to reply to this topic.