Questions tagged [suitescript2.0]

SuiteScript 2.0 is the second version of the NetSuite SuiteScript API. SuiteScript 2.0 and SuiteScript 1.0 coexist at the moment, but cannot be used within the same script.

API Reference

991 questions
2
votes
1 answer

Netsuite - Schedule a report by script

I have requirement to create csv file from a reports and save this file in the file cabinet folder by Suite Script. Is it possible to do so. can reports be exported into csv file by script.
Aashi
  • 21
  • 3
2
votes
1 answer

Issue in running a client script in NetSuite suitescript 2.0

I have a client script in NetSuite 2.0 which is already running ,but if I am making any changes to it, the new changes are not getting reflected the script is still running with the old code. Even if I try to add single log.debug it is not getting…
2
votes
1 answer

NetSuite - suitescript : Rescheduling a Map/Reduce script to Run after a specific time on failure

I am using Suitescript 2.0. There I am trying to reschedule a script for a particular type of error. I got the below code which can be used to rescheduled the script immediately. var scriptTask = task.create({ taskType:…
Monaj
  • 245
  • 3
  • 15
2
votes
3 answers

SuiteScript 2.0 TypeError Cannot call method "getValue" of undefined

I'm trying to get the values from two transaction body field using this code below . /** *@NApiVersion 2.x *@NScriptType UserEventScript *@param {Record} context.currentRecord */ define(['N/record'], function (msg) { function…
eklon
  • 107
  • 1
  • 12
2
votes
1 answer

NetSuite: How to Reference Custom Fields in Grouped Invoices Using Advanced PDF/HTML Templates

We are using NetSuite's Advanced PDF Template for Grouped Invoices to print groups of invoices and need to include an existing custom field (custbody_subscription_name from the invoice header) on each invoice row in the invoice group. We can add…
A2MetalCore
  • 1,621
  • 4
  • 25
  • 49
2
votes
1 answer

NetSuite SuiteScript 2.0 - Attach File Object to Email Being Sent Via SuiteScript

I am writing a script where I am trying to print a transaction and then email it. I keep getting the following error. "Wrong parameter type: options.attachments is expected as file.File[]." I can't tell what is wrong with my code. Here is the…
2
votes
1 answer

Using Suitescript 2.0, how can I search records for sublist items with specific values

I need a search that looks for line items with a specific value in a custom field - custcolunique_id I am using the search below, but am getting a SSS_INVALID_SRCH_OPERATOR error due to custcolunique_id. That is definitely the internal field ID…
djbrazzy
  • 21
  • 4
2
votes
2 answers

Operators 'and' & 'or' on filters SuiteScript 2.0 (NetSuite)

I need to make conditions on my filters in my search. I have browsed through a lot of forums without finding functional solutions. After many inconclusive tests, I come to you for help. My code : function retrieveVendor(vendorValues){ var…
MisterFring
  • 41
  • 1
  • 5
2
votes
2 answers

NetSuite SS 2.0: Salesorder Custom address

We are currently importing Salesorder from 3rd party, The Salesorder creation is done fine. We are struggling with the shipping address, we need to create a custom shipping address at each new salesorder. when we use the following code, only the…
Komagain
  • 378
  • 1
  • 10
2
votes
3 answers

NetSuite - writing a file to Suitelet response to directly download file

Hope you can help. Something which appears so small is bugging the heck out of me!! All I want to do in SuiteScript 2.0 is directly download a CSV file to the client as soon as I hit the SUBMIT button on a Suitelet. My code downloads to the client,…
Arif WB
  • 186
  • 1
  • 13
2
votes
1 answer

Loading custom module base on context in server side SuiteScript 2.0

I'm trying to load my custom module base on the condition. CustomModule.js define([], function(){ export { run: function(){ log.debug('run in CustomModule' } }; } And here is my user event script userevent.js define(['N/record'],…
Lin Shih Hao
  • 341
  • 1
  • 3
  • 10
2
votes
2 answers

SuiteScript 2.0 Update Custom Line Field BeforeSubmit

I have customized a ready Script to get Lot Expiration Date,it is working fine in Edit mode for Old Records; but in Create Mode it will raise an Error here is the Code: /** * @NApiVersion 2.0 * @NScriptType UserEventScript * @NModuleScope…
Bashar Awwad
  • 37
  • 1
  • 8
2
votes
1 answer

How do I load a file from FileCabinet in SuiteScript

I want to import a csv file using a saved csv import in suitescript. For this I'm testing my code in the script debugger. I successfully did this in Suitescript 1.0 like this: var import1 = nlapiCreateCSVImport();…
2
votes
2 answers

SuiteScript2.0 Getting values from a saved search formula column

I am trying to get the value from a formula field in a saved search. I am getting all the results and then looping through them as such. for(key in itemReplenishResults){ log.debug("Single Data", JSON.stringify(itemReplenishResults[key])); …
Tom Hanson
  • 873
  • 10
  • 39
2
votes
1 answer

How can I add a line item to sublist via beforeSubmit event?

I'm creating a beforeSubmit script that needs to add a new line item to a sublist and commit both. I've tried use selectLine, insertLine and selectNewLineItem, but no one worked adding the line during the record save: …