NElliott
11/08/2024, 7:52 AMCeligo AI
11/08/2024, 7:52 AMAI generated answer (using internal Slack threads):Yes, in SuiteScript 2.0 you can set a company-level script parameter. You can use the
N/config
module to load the company preferences and set the value of the script parameter. However, please note that the user executing the script must have the 'Set Up Company' permission to access the Company Preferences.
Here is a sample code snippet:
javascript
var config = require('N/config');
var companyPreferences = config.load({type: config.Type.COMPANY_PREFERENCES});
companyPreferences.setValue('scriptId', 'parameterId', 'value');
companyPreferences.save();
In this code, replace 'scriptId'
, 'parameterId'
, and 'value'
with your actual script ID, parameter ID, and the value you want to set, respectively.
Also, you can use runtime.getCurrentScript()
to get the values from company-level script parameters.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
11/08/2024, 7:52 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849993587
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.844994426
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839271784
Celigo AI
11/08/2024, 7:52 AM