Can I access script parameter values on a deployme...
# ask-stanley-ai
n
Can I access script parameter values on a deployment from another script. For example, can i search for or load a script deployment record and evaluate any parameter values stored against the deployment where the level is not set to company or user
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that accessing script parameter values on a deployment from another script is possible under certain conditions. If the script parameter is set at the company level, it can be accessed by other scripts using the
N/config
module. Here is an example of how you can do this:
Copy code
javascript
var config = require('N/config');
var companyPreferences = config.load({ type: config.Type.COMPANY_PREFERENCES });
var parameterValue = companyPreferences.getValue({ fieldId: 'custscript_your_param' });
However, if the script parameter is not set at the company or user level, it seems that you cannot directly access it from another script. The
record.load
method does not return the script parameter values when loading a script deployment record. If you need to share values between scripts and those values are not company or user preferences, you might need to store them in a different way. For example, you could use a custom record or a Suitelet to store and retrieve these values. ****** 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.880571604
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.876792669
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.87469548
Please provide your feedback on this answer.