Retrieve Information for a SuiteApp

The following script sample performs these tasks:

Some of the values in this sample are placeholders, such as the bundleId and suiteAppId values. Before using this sample, replace all hard-coded values, including IDs, with valid values from your NetSuite account. If you run a script with an invalid value, the system may throw an error.

Note:

This sample script uses the require function so that you can copy it into the SuiteScript Debugger and test it. You must use the define function in an entry point script (the script you attach to a script record and deploy). For more information, see SuiteScript 2.x Script Basics and SuiteScript 2.x Script Types.

          /*
 * @NApiVersion 2.x
 * 
 */

// This script sample uses each method available in the N/suiteAppInfo module to retrieve information about installed bundles and SuiteApps installed in the current account.

require(['N/suiteAppInfo'], function (suiteAppInfo){
    var isBundleInstalled = suiteAppInfo.isBundleInstalled({
        bundleId: '1234'
    });
   
   var isSuiteAppInstalled = suiteAppInfo.isSuiteAppInstalled({
        suiteAppId: '789'
    });

    var allMyBundlesInstalled = suiteAppInfo.listInstalledBundles();

    var allMySuiteAppsInstalled = suiteAppInfo.listInstalledSuiteApps();

    var myScripts = {"scriptA", "scriptB", "scriptC"};
    var scriptInBundles = suiteAppInfo.listBundlesContainingScripts({
        scriptIds: myScripts
    });

    var scriptInSuiteApps = suiteAppInfo.listSuiteAppsContainingScripts({
        scriptsIds: myScripts
    });
}) 

        

General Notices