This article is relevant if you are a NetSuite Administrator and you are not sure what the “Expand Account Lists” switch does.
Background
While I was developing a SuiteBundle installation script, I needed to create a Payment Item in code. I was having no problem with my installation on our test accounts. But then on one test account, I was having trouble.
I discovered that the list of accounts available to the Payment Item drop down list was too short. It only contained the current assets: Checking and Accounts Receivable. My code needed to reference an expense account type which was not available in the list. It wasn’t at all obvious about why this one account didn’t show all the accounts like my other test accounts.
With some additional review, I discovered the issue.
Expand Account Lists
The Expand Account Lists basically reveals the entire chart of account versus the typical account that may be relevant within the context of the application. Hence, NetSuite is trying to make it easier for the average user to setup their account. Once I enabled that feature, all was good. But now, I better update install script to avoid this problem in the future.
Enhanced SuiteBundle Installation Script
In order to enhance my SuiteBundle Installation Script, I added the following code pattern to effectively check if this preference is enabled. Because I anticipate additional preference that may need to be verified, I developed the code to easily add preference references via constants.
//these constants are at the top of the script file
//work the preference list which is multi-dimensional; var CONST_PREFERENCE_MANDATORY = new Object(); //setup sub types CONST_PREFERENCE_MANDATORY.accountingpreferences = new Object(); CONST_PREFERENCE_MANDATORY.accountingpreferences.ASSETCOGSITEMACCTS = 'T';
//this function is called by the main beforeInstall or beforeUpdate script events
function verifyPreferences(){ for (pref in CONST_PREFERENCE_MANDATORY) { for (subpref in CONST_PREFERENCE_MANDATORY[pref]){ checkPreferenceEnabled(pref, subpref, CONST_PREFERENCE_MANDATORY[pref][subpref]); }; }; function checkPreferenceEnabled(pref, subpref, subprefval) { nlapiLogExecution('DEBUG','Checking preference, sub preference, sub pref value', pref + ', ' + subpref + ', ' + subprefval); var config = nlapiLoadConfiguration(pref); if (config.getFieldValue(subpref) == subprefval){ nlapiLogExecution('DEBUG','Check preference passed'); return true; } else { throw new nlobjError('INSTALLATION_ERROR','Preference: '+ pref + ', Sub Preference: ' + subpref + ' must be enabled to ' + subprefval + ' . Please enable the preference and re-try using \'Action, Update\'.'); }; }; return; };
Get Help to Optimize Your NetSuite System
If you need any help enhancing your NetSuite environment, contact us.