Skip to content

Commit

Permalink
Finalized SS 2.0 feature dump implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Mar 27, 2017
1 parent dd1362e commit df1fc39
Showing 1 changed file with 47 additions and 17 deletions.
64 changes: 47 additions & 17 deletions lib/templates/netsuite_features.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,52 @@
require(['N/config'],
function(config) {
function getFeatures() {
var featureInfo = config.load({
type: config.Type.FEATURES
});

var features = {};
var featureList = featureInfo.getFields()

for(var k in featureList) {
features[featureList[k]] = featureInfo.getValue(featureList[k]);
}

JSON.stringify(features)
/**
* @NApiVersion 2.x
* @NScriptType restlet
*/

/*
## Upload Script
https://system.sandbox.netsuite.com/app/common/scripting/uploadScriptFile.nl
File Name: netsuite_features.js
## Create RESETLEt
Name: Feature Inspection
ID: _feature_inspection
Description: Dump features as JSON. Do not install in production.
Deployments > Title: Feature Inspection
Deployments > Status: Released
*/

define(['N/config'], function(config) {
return {
get: function() {
var allConfigTypes = [
config.Type.FEATURES,
config.Type.COMPANY_INFORMATION,
config.Type.COMPANY_PREFERENCES,
config.Type.ACCOUNTING_PREFERENCES
];

var features = {};

for(var typeIndex in allConfigTypes) {
var type = allConfigTypes[typeIndex];

var featureInfo = config.load({
type: type
});

features[type] = {};

var featureList = featureInfo.getFields()

for(var k in featureList) {
features[type][featureList[k]] = featureInfo.getValue(featureList[k]);
}
}

return getFeatures();
return features;
}
}
});


'debug';

0 comments on commit df1fc39

Please sign in to comment.