I'm adding more than 1,000 lines to a sublist of t...
# ask-stanley-ai
a
I'm adding more than 1,000 lines to a sublist of type "LIST" in my suitelet script. The sublist is created by the suitelet and so is the form the sublist is part of. However, when the page loads, it only shows the first 1,000 lines. How can I get it to show all the lines?
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** The issue you're encountering is due to the inherent limitation of the
LIST
type sublist in NetSuite. The
LIST
type sublist has a fixed number of lines and you cannot add more than 1,000 lines to it. This is a known limitation in NetSuite and is documented in their official documentation. However, you can work around this limitation by using pagination. You can divide your data into pages, each containing a maximum of 1,000 lines, and then provide navigation controls for the user to move between pages. Here is a simplified example of how you can implement pagination:
Copy code
javascript
var sublist = form.addSublist({
    id: 'custpage_results',
    type: serverWidget.SublistType.LIST,
    label: 'Search Results'
});

// Add navigation fields
form.addField({
    id: 'custpage_page',
    type: serverWidget.FieldType.INTEGER,
    label: 'Page'
}).defaultValue = page;

form.addField({
    id: 'custpage_pages',
    type: serverWidget.FieldType.INTEGER,
    label: 'Total Pages'
}).defaultValue = totalPages;

// Add navigation buttons
form.addButton({
    id: 'custpage_prev',
    label: 'Previous',
    functionName: 'goToPreviousPage'
});

form.addButton({
    id: 'custpage_next',
    label: 'Next',
    functionName: 'goToNextPage'
});
In this example,
custpage_page
and
custpage_pages
are fields that display the current page and total pages, respectively.
custpage_prev
and
custpage_next
are buttons that navigate to the previous and next page, respectively. The
goToPreviousPage
and
goToNextPage
functions would be defined in your client script and would reload the Suitelet with the appropriate page number. Please note that this is a simplified example and you would need to adapt it to your specific use case.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.868042
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865478516
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.864379942
Please provide your feedback on this answer.