38
Points
Questions
0
Answers
6
-
It is odd that you are running into governance while reading search results unless your doing something else that consumes governance for each result.
It’s hard to make any recommendations on how to handle governance without viewing your code.
You may be able to optimize the script to reduce governance.
If you can’t optimize you are going to need to find a way to break up the processing between multiple runs.
1. You could use a map/reduce script that has a lot of advantages when processing large amounts of data.
2. You can use a scheduled script that can process results until governance runs low and then reschedule. You can query governance remaining with the N/runtime module.
- 575 views
- 4 answers
- 0 votes
-
You will use the N/Record module to transform the record.
Something like below.
var unbuildRecord = record.transform({ fromType: record.Type.ASSEMBLY_BUILD, fromId: scriptContext.currentRecord.id, // this will depend on the script being used toType: record.Type.ASSEMBLY_UNBUILD, isDynamic: true }); // ... Do anything necessary to the Assembly Unbuild record unbuildRecord.save();
This answer accepted by NSP17. on July 20, 2022 Earned 15 points.
- 233 views
- 1 answers
- 0 votes
-
If your file is in the SuiteScipts directory.
You would include like this. ‘/lodash.min’. You don’t include SuiteScripts since it is the root directory.- 852 views
- 1 answers
- 0 votes
-
What I would do is create a Suitelet script with a field of type FILE, and a button.
When the user presses the button it sends POST to the same suitelet script.
Have the POST request parse the CSV file with
'N/file'
or what I use is Papa Parse (you can load into the script like this'../modules/papaparse.min'
).Once you have parsed the file and loaded into a Javascript Object then use it to create the record.
You can redirect the user to created record after it finishes saving.
- 1262 views
- 4 answers
- 0 votes
-
Might be easier to just create a User Event script or possibly a workflow on the email record to validate whether an email can be sent and if not throw an error.
- 241 views
- 1 answers
- 0 votes
-
My guess is that you need to switch how you get the customer id.
From:
recipients: customer.id,
To:
recipients: customer.getValue('internalid'),
- 358 views
- 1 answers
- 0 votes