Does a map reduce script have access to a COMPANY ...
# ask-stanley-ai
d
Does a map reduce script have access to a COMPANY script preference from a Suitelet script? Using the N/config module?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it appears that a Map/Reduce script can indeed access a COMPANY script preference from a Suitelet script using the
N/config
module. In NetSuite, you can define script parameters as having either company or user preferences. If you set a script parameter to company, it can be accessed by all scripts through the
N/config
module. Here is an example of how you can access a company script parameter:
Copy code
javascript
var config = require('N/config');
var companyConfig = config.load({type: config.Type.COMPANY_PREFERENCES});
var parameterValue = companyConfig.getValue('custscript_your_param');
In this example,
custscript_your_param
is the ID of the company script parameter you want to access. Remember, you can also set the value of a COMPANY-level script parameter from a Suitelet script. This can be useful if you want to allow users to set values, filters, etc. from a Suitelet and then use those values in a Map/Reduce script. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844559729
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84031719
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833347738
Please provide your feedback on this answer.