Is it doable if I want to get the Inventory Valuat...
# general
y
Is it doable if I want to get the Inventory Valuation Report result using some API?
j
Hey Yinghai - Yes, it is possible to get the Inventory Valuation Report result using an API in NetSuite. NetSuite provides a SuiteScript API, which allows you to programmatically access and manipulate various parts of the system, including reports. To retrieve the Inventory Valuation Report result using SuiteScript, you will need to use the nlapiSearchRecord() function, which allows you to perform a search on a specific record type and retrieve the results. You will need to pass the record type "Inventory Valuation" and additional parameters such as filters, columns and other conditions. The function returns an array of search results that you can use to extract the information you need. You will also need to have the necessary permissions and access to use the SuiteScript API in NetSuite. Alternatively, you can use SuiteAnalytics Connect to extract the report data, this will allow you to connect to NetSuite with a third-party BI tool and get the inventory report data and visualize it in a more user-friendly way.
y
I just followed a simple hello world tutorial given by Oracle. Seems like the javascript file is triggered upon opening a specific page in netsuite. So, my question is how can I trigger the javascript file from my local device? Also, is there a way to extract more rows when using nlapiSearchRecord API? Its limitation now is 1000 rows as per this doc (https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N3051062.html)
j
If by local you mean your development environment - you can use the SuiteCloud IDE (Integrated Development Environment) provided by NetSuite. The SuiteCloud IDE is a plugin for Eclipse or Visual Studio Code that allows you to create, edit, and deploy SuiteScripts directly from your local machine. Here are the general steps to trigger a JavaScript file from your local device in NetSuite: 1. Install the SuiteCloud IDE plugin for Eclipse or Visual Studio Code. 2. Create a new project in the SuiteCloud IDE and add your JavaScript file to the project. 3. Use the SuiteCloud IDE to deploy the project to your NetSuite account. 4. Once the project is deployed, you can trigger the JavaScript file by calling it in a SuiteScript file or through a user event script, scheduled script, map-reduce script, or a Restlet. 5. You can also test the script by going to the script deployment page in NetSuite and running the script.
1. From the drop-down menu, select the "Help Center" option. 2. You will be redirected to the NetSuite Help Center, where you can access the user guide and other resources.
To retrieve more than 1000 rows, you can use the "setPaging" method to specify the number of results per page and the "setPage" method to specify the page number.
For example, to retrieve the next 1000 rows after the initial 1000 rows, you can use the following code:
var search = nlapiCreateSearch(...); search.setResultsPerPage(1000); search.setPage(2);
y
Thanks a lot for your help Capo! One question I have now is this dependency issue. I tried removing special characters (https://github.com/oracle/netsuite-suitecloud-sdk/issues/470) and downgrade java version to 17, but still doesn’t work. Any thoughts on this?
nvm, I think I figured that out
j
Excellent, I just saw your message, I was offline late yesterday