SuiteScript 2.X Generative AI APIs

SuiteScript Generative AI APIs (N/llm Module) enable you to work with generative artificial intelligence (AI) in NetSuite using SuiteScript. You can use these APIs to send requests to large language models (LLMs) and to receive responses from them. NetSuite accesses LLMs through an integration with the Oracle Cloud Infrastructure (OCI) Generative AI service. NetSuite provides… Continue reading SuiteScript 2.X Generative AI APIs

Resolve Error: “SSS_INVALID_SRCH_OPERATOR” on RESTlet

Scenario: User has a RESTlet script that is getting the value of the dynamic filter from the request parameter. However, user is getting an error: “SSS_INVALID_SRCH_OPERATOR”. When the script operator parameter value is hard-coded, error is not reproducible. Solution: The reason why the error: “SSS_INVALID_SRCH_OPERATOR” is encountered when using script parameters as search operator is… Continue reading Resolve Error: “SSS_INVALID_SRCH_OPERATOR” on RESTlet

Reserved Parameter Names in Suitelet URLs

Certain names are reserved and should not be referenced when naming custom parameters for Suitelet URLs. The following table contains a list of reserved parameter names: If any of your parameters are named after any of the reserved parameter names, your Suitelet may throw an error saying, “There are no records of this type.” To… Continue reading Reserved Parameter Names in Suitelet URLs

Resolve Type Error: email.send is not a function

Scenario: When we use email.send function in suitescript, sometimes this type error: email.send is not a function will be thrown. Solution: Check and confirm N/email module is added. Check the parameters passed to send email function, or the variable used to assign the email id. This error mainly occurs, when we use parameters as ’email’… Continue reading Resolve Type Error: email.send is not a function

The advantages of SOAP services over REST, specifically in the context of NetSuite API integration.

1. SOAP vs REST : 1.1 NetSuite SOAP API’s Advantage: Despite its age and being less modern compared to REST APIs, NetSuite SOAP API is more reliable for certain operations, especially for writing data into NetSuite. This contrasts with the common belief that modern REST APIs are always superior. 1.2 Comprehensive Access with SOAP: The… Continue reading The advantages of SOAP services over REST, specifically in the context of NetSuite API integration.

How do we script to be able to more than 4000 rows using the forEachResult() method?

To overcome this limitation you can: Use Search.run().getRange() to iterate the full result set by range, and then iterate the results contained in each range. Use Search.runPaged(), fetch the data for each page and iterate the results. Example: var searchObj = searchObjSearch.runPaged({ pageSize:1000 }); searchObj.pageRanges.forEach(function (pageRange) { searchObj.fetch({ index:pageRange.index }) .data.forEach(function (result) { //Process each search result here }); csv.push(row);… Continue reading How do we script to be able to more than 4000 rows using the forEachResult() method?

Last Sales Activity Module

To track the last sales activity, the Last Sales Activity SuiteApp adds the Last Sales Activity field in lead, prospect, customer, contact, and opportunity records. This field displays the date when a sales activity was last performed for that record. To view the record of a sales activity, click the link in the Last Sales Activity field. The Last Sales… Continue reading Last Sales Activity Module

Difference between addSelectOption(options) And insertSelectOption(options)

Field.addSelectOption(options) Adds the select options that appears in the dropdown of a field. SuiteScript 2.x Suitelet Script Type and SuiteScript 2.x User Event Script Type (beforeLoad(context)) After you create a select or multi-select field that is sourced from a record or list, you cannot add additional values with Field.addSelectOption(options). The select values are determined by… Continue reading Difference between addSelectOption(options) And insertSelectOption(options)

Fetch value from Select and Checkbox fields in suitelet

For the custom SELECT fields and CHECKBOX fields, sometimes we cannot fetch the data directly using their id from suitelet. Solution: Inspect and check the structure of the field. Sometimes, the select element you’re trying to access is actually a custom dropdown or a select field wrapped inside a more complex HTML structure, possibly generated… Continue reading Fetch value from Select and Checkbox fields in suitelet