SCA Reference My Account 1.02 - 1.06 and ShopFlow 1.02 – 1.07
You can edit the file, commons.js
, in the NetSuite File Cabinet. See Editing Files in the File Cabinet.
-
Go to Documents > Files > File Cabinet.
-
For My Account, go to Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. -My Account X.Y.Z > Custom My Account > ssp_libraries.
For ShopFlow, go to Web Site Hosting Files > Live Hosting Files > SSP Applications > NetSuite Inc. -ShopFlow X.Y.Z > Custom ShopFlow > ssp_libraries.
Important:Replace the string, X.Y.Z, with the version of My Account or ShopFlow that you are using.
-
Create a backup of the file,
commons.js
.Note:If
commons.js
does not exist in the ssp_libraries directory, make a copy from Web Site Hosting Files > Live Hosting Files > SSP Applications > Netsuite Inc. -ShopFlow X.Y.Z > Reference My Account > ssp_libraries > commons.js. -
In the
commons.js
file, find and replace the following line of code with the provided code sample.Find the following code:
function recordTypeExists (record_type_name) { 'use strict'; try { nlapiCreateRecord(record_type_name); } catch (error) { return false; } return true; } // returns true if and only if the given field_name exists on the given record_type_name. function recordTypeHasField (record_type_name, field_name) { 'use strict'; try { var record = nlapiCreateRecord(record_type_name); return _.contains(record.getAllFields(), field_name); } catch (error) { return false; } }
Replace it with the following code:
function recordTypeExists (record_type_name) { 'use strict'; try { nlapiCreateSearch(record_type_name, null, [], []); } catch (error) { return false; } return true; } // returns true if and only if the given field_name exists on the given record_type_name. function recordTypeHasField (record_type_name, field_name) { 'use strict'; try { nlapiLookupField(record_type_name, 1, field_name); return true; } catch (error) { return false; } }
-
Save and deploy the file.