Function to validate the NetSuite environment

const isValidEnvironment = () => {
    try {
        // add required NetSuite environments
        let accessEnvironments = {
            "SANDBOX": runtime.EnvType.SANDBOX,
            "PRODUCTION": runtime.EnvType.PRODUCTION
        }
        return Object.values(accessEnvironments).some(el => el === runtime.envType);
    } catch (err) {
        log.error("error@isValidEnvironment");
        return false;
    }
}

Leave a comment

Your email address will not be published. Required fields are marked *