bputnam
06/07/2022, 8:33 PMMatt Bernstein
06/07/2022, 8:37 PMbputnam
06/07/2022, 8:40 PM<deploy>
<run>
<script>
<path>~/Objects/customscript_install_script.xml</path>
<deployment>customdeploy1</deployment>
</script>
</run>
<files>
<path>~/FileCabinet/SuiteApps/../*</path>
</files>
<objects>
<path>~/Objects/customscript_install_script.xml</path>
</objects>
</deploy>
bputnam
06/07/2022, 8:40 PM/**
* @NApiVersion 2.0
* @NScriptType SDFInstallationScript
*/
define(['N/runtime'], function(runtime) {
function checkPrerequisites() {
log.debug("SOAP WEB SERVICES check", !runtime.isFeatureInEffect({feature: 'WEBSERVICESEXTERNAL'}))
// other feature pre-requisites: restwebservices & tba & webservicesexternal
if (!runtime.isFeatureInEffect({
feature: 'RESTWEBSERVICES'
}))
throw 'The SOAP WEB SERVICES feature must be enabled. ' +
'Please enable the feature at Setup -> Company -> Enable Features -> SuiteCloud and try again.';
if (!runtime.isFeatureInEffect({
feature: 'WEBSERVICESEXTERNAL'
}))
throw 'The SOAP WEB SERVICES feature must be enabled. ' +
'Please enable the feature at Setup -> Company -> Enable Features -> SuiteCloud and try again.';
if (!runtime.isFeatureInEffect({
feature: 'TBA'
}))
throw 'The SOAP WEB SERVICES feature must be enabled. ' +
'Please enable the feature at Setup -> Company -> Enable Features -> SuiteCloud and try again.';
if (!runtime.isFeatureInEffect({
feature: 'PI_REMOVAL'
}))
throw 'The SOAP WEB SERVICES feature must be enabled. ' +
'Please enable the feature at Setup -> Company -> Enable Features -> SuiteCloud and try again.';
}
return {
beforeInstall: function beforeInstall(params) {
checkPrerequisites();
},
beforeUpdate: function beforeUpdate(params) {
checkPrerequisites();
}
};
});
Matt Bernstein
06/07/2022, 8:43 PM/**
* @NAPIVersion 2.1
* @NScriptType SDFInstallationScript
*/
define([],
() => {
/**
* Defines what is executed when the script is specified by the SDF deployment(in the deploy.xml file of an SDF project).
* @param {Object} scriptContext
* @param {fromVersion} scriptContext.fromVersion - The version of the SuiteApp currently installed on the account. Specify null
* if this is a new installation.
* @param {toVersion} scriptContext.toVersion - The version of the SuiteApp that will be installed on the account.
* @since 2015.2
*/
const run = ( scriptContext ) => {
if (!scriptContext.fromVersion) {
log.audit("Installing for first time");
}
};
return { run };
});
Matt Bernstein
06/07/2022, 8:45 PM<sdfinstallationscript scriptid="customscript_app_install">
<description></description>
<isinactive>F</isinactive>
<name>SuiteApp | Install</name>
<notifyadmins>F</notifyadmins>
<notifyemails></notifyemails>
<notifyowner>T</notifyowner>
<notifyuser>F</notifyuser>
<scriptfile>[/SuiteApps/...]</scriptfile>
<scriptdeployments>
<scriptdeployment scriptid="customdeploy_app_install">
<isdeployed>T</isdeployed>
<loglevel>DEBUG</loglevel>
<status>RELEASED</status>
<title>SuiteApp | Install</title>
</scriptdeployment>
</scriptdeployments>
</sdfinstallationscript>
Matt Bernstein
06/07/2022, 8:48 PMbputnam
06/07/2022, 9:44 PM/**
* @NAPIVersion 2.1
* @NScriptType SDFInstallationScript
*/
is that correct?Matt Bernstein
06/07/2022, 9:45 PMbputnam
06/07/2022, 9:47 PMbputnam
06/08/2022, 3:01 PMMatt Bernstein
06/08/2022, 3:02 PM