This topic contains 6 replies, has 2 voices, and was last updated by Arun Reddy 4 years, 1 month ago.

  • Author
    Posts
  • #6410 Score: 0

    cgunadi@nextcoder.com
    • Contributions: 0
    • Level 1

    What I need to accomplish is:

    Invoke a Netsuite Saved Report via API (SOAP? restlet?), and to be able to pass some parameter to the Report like the Start and End Date.

    I need to get the Report result back in some text/XML/CSV/JSON/other format.

    Is this possible to do in Netsuite/SuiteTalk?

    If not what is the best workaround to accomplish the same thing?

    I understand the Report has “Excel Web Query” option, but it doesn’t allow me to pass any parameter (start/end date) to the Report.

    Thank you so much for any hints/pointer.

    = Cancan Gunadi
    This is a cached copy. Click here to see the original post.

  • #6411 Score: 0

    taylor@abptech.com
    • Contributions: 0
    • Level 1

    The easiest way to set this up is to use a RESTlet. The linked article (https://netsuite.custhelp.com/app/an…irst%20restlet) gives detail, but basically you do this:Create the RESTlet File and Add It to the File Cabinet
    Create the RESTlet Script Record
    Define RESTlet Deployment(s)

    The RESTlet file will need to contain the function that accepts the parameter. The attached file is actually a working example function named executeSavedSearchSN that accepts request as the parameter to the saved search called customsearch1521 and then outputs the results in sns (serial numbers).

    Then, you need to access the RESTlet via whatever scripting language you are using external to Netsuite. I can’t help you there, but this article can: https://netsuite.custhelp.com/app/an…ail/a_id/24420. The results will be in json format.

    Good luck!

    Attached Files

    restlet.zip

    (626 Bytes, 1 view)

    • #26127 Score: 0

      Arun Reddy
      Member
      • Contributions: 1
      • Level 1
      @arun_reddy

      Hi

      Thank you for the answer. But for some reason I am not able to see the file. Is there some place where I can get this sample file from?

  • #6412 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    Reports cannot be returned as anything else than HTML. So in theory you could invoke the page and consumed the results, but you’ll be parsing through HTML that really isn’t meant to be parsed.

    Typically, you would build a Saved Search that returns the same data the report has (more or less) and then just consume that. Is that not an option?

  • #6413 Score: 0

    cgunadi@nextcoder.com
    • Contributions: 0
    • Level 1

    Thank you both for the pointers.

    I will look into the example.

    Olivier,

    As far as Saved Search is concerned, can it really replicate the result from a search, for example a “Sales by Customer Summary Ranked By Total Sales” report ?

  • #6414 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    Yes, rather easily in that particular case.

  • #6415 Score: 0

    cgunadi@nextcoder.com
    • Contributions: 0
    • Level 1

    Hi Olivier and all,

    I’ve created a simple Saved Search which just returns me Customer List for now.

    And I tried to use the “search” SOAP API and pass it a “CustomerSearchAdvanced”.

    But no matter what I did, I keep getting “Invalid account number” error.

    In that same program I could call the “login” function ok via SOAP API, where I gave the correct Application ID and my login credential.

    The Application/Integration is created within the correct Account.

    Do you or anyone know what could go wrong?

    The Netsuite user account I used has Admin Role and a Web Service Role (a new Role that has the Web Service access enabled).

    Is there anywhere else I need to set permissions ?

    Thank you for any pointer.


    delilahruch replied on 05/25/2017, 09:16 AM: Hi there,

    Were you able to figure this out? I am trying to work on a way for a group of contracted representatives to search for customers and need to set up exactly what’s described above.

    Delilah

You must be logged in to reply to this topic.