This topic contains 4 replies, has 0 voices, and was last updated by Ferdinand 6 years ago.

  • Author
    Posts
  • #21236 Score: 0

    Ferdinand
    • Contributions: 0
    • Level 1

    Hello,

    I've made a Suitelet that combines results from multiple searches for our purchasing into one list.

    I'd like to add a button/link for exporting that list to an Excel file for easy editing, because the list serves as a draft for creating a new purchase order.

    The normal export buttons (CSV/Excel/PDF) which can be used for Saved Searches are not available for Suitelet lists. Is there another solution for this?

    I bet I'm not the first one who's tried to do this, please help
    This is a cached copy. Click here to see the original post.

  • #21237 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    Yeah, just custom build the logic. You won't really be able to do Excel (except as an XML), but CSV is a plain text file. So just output a file at the click of a button.


    Ferdinand replied on 05/02/2018, 02:37 AM: That’s what I feared, but thanks for confirming!

    I’ve found Article 25750 on SuiteAnswers now which seems to go in this direction, so I’ll try to work from there.

  • #21238 Score: 0

    pcutler
    • Contributions: 0
    • Level 1

    This is a common request, a few options:Copy/paste into Excel, sometimes that works
    Click "Customize View", add a filter for the current record, and click Preview and then export the previewed search results
    If you have access to a consultant or developer, ask them to write a script for you that adds an export button to the sublist
    We've considered offering a SuiteApp that adds an export button to all sublists, do you think that's something your company might be in the market for or is this a minor one-off request?


    Ferdinand replied on 05/02/2018, 03:07 AM: Thanks for the answer,

    1. Actually that sort of works (I hadn’t tried), but I’d like to provide a better / more time-saving solution to our purchasing

    2. Customize View is not available, probably because it’s a list instead of a sublist, anyway some columns are calculated programmatically not by a formula so this wouldn’t work

    3. That’s what I’ll do myself, if you have any script or code snippets to share (other than article 25750) I’d be glad to have a look

    It’s only one Suitelet at the moment where we need this (maybe I’ll make more in the future, but probably not many). It’s just a small project I’m doing on my own initiative to improve our purchasing processes, I don’t think our MD would approve purchasing a SuiteApp for this, sorry

  • #21239 Score: 0

    pcutler
    • Contributions: 0
    • Level 1

    I don't have code written at this point, but the basic process I'd follow is:With a tool like Fiddler or your web browser's developer tools, you can see the URL NetSuite requests and the HTML/JavaScript response when navigating between multiple pages of results.
    You can make web requests for that paginated data from either a client script leveraging the current login session or a server script with an NLAuth header
    Unfortunately that response is in an HTML table form, so that table would have to be parsed and converted to your desired format – XML, CSV etc.
    Once the data is available, a Suitelet can set the content type to CSV, XML etc. and serve up the desired content type

  • #21240 Score: 0

    Ferdinand
    • Contributions: 0
    • Level 1

    Thank you for the reply pcutler, but I think that process is more complicated than necessary. Maybe I haven't communicated the problem well enough:

    I'm not trying to capture data from some 3rd party Suitelet, I'm the author of the Suitelet that's creating the data and just looking for another way to output it (i.e. as an Excel file). Also I'm using the nlobjList UI object, so the results are not paginated, they look like the below screenshot:

    I tried adding a button to the list that calls the function for creating the file, but noticed that this would have to be a separate client script which then has to call a Suitelet again, so that's more steps than I'd like. Also that way the user would have to wait 2 times for the searches & calculation to run which can take almost a minute (first I do an item search to determine lines / items with back orders, and then I run one transaction search for each line to find pending shipments for that item (and kits containing the item)). Instead I've opted to add a selection to the GET request where the user can choose the output format:

    Still got to write the code that actually outputs the Excel file, though. Seems like I need to learn about the Office Open XML format first, haven't used that before…

You must be logged in to reply to this topic.