www.codeboxllc.com/ksc will be our new home.
I'll keep this site open for a bit.
Come Visit me at my new house!!!!!
NetSuite, SuiteScript, SuiteFlow, JavaScript, Pardot, Ektron, ASP.Net C#
var flds=['department','class'];After testing out the function against other native records such as Customer record type, I called NetSuite Support and asked about it. The support rep. told me that there is an existing defect out there for nlapiSubmitField API call in v2011.2. The problem was, I WASN'T!
var vals=[19,51]; //internal ID of department and class
var rectype='salesorder';
var recid=555; //internal ID of sales order record
nlapiSubmitField(rectype, recid, flds,vals);
Upon further investigation, it appears that the Department and Class fields in the Sales order record are both "non-direct list editable", the nlapiSubmitField in this case behaves as designed. The nlapiSubmitField function will only work for fields which can be Direct List Edited. You can see this on the help guide. Here is the path: SuiteFlex (Customization, Scripting, and WebServices) > SuiteScript > Scripting Records, Fields, Forms, and Sublists > Direct List Editing and SuiteScript > Direct List Editing Using nlapiSubmitFieldMy problem with this response from the support rep. is that no where on that Help section does it say that Department and Class fields are categorized as None-Direct list editable.
In SuiteScript, you cannot direct list edit select fields. In other words, you cannot call nlapiSubmitField on a select field.If you look at Department and Class field in SuiteScript Recrods Browser both are indeed labeled as select fields. What's MORE interesting is that I have used nlapiSubmitField function to set select fields!!!!!!!!!
var soid='123';My thought is NetSuite should update their documentation to provide Non-Direct editable fields list.
var deptid='19';
var clsid='51';
var so=nlapiLoadRecord(rectype, trid);
so.setFieldValue('department',deptid);
so.setFieldValue('class',clsid);
nlapiSubmitRecord(so);
nlapiGetContext().getSetting('SCRIPT','YOUR CUSTOM FIELD ID');
nlapiGetContext().getSetting('SCRIPT','custscript_testparam');I can't wait to go back and rewrite all my scripts. Happy coding everyone!
When an item is added with certain country, it pro grammatically adds country specific surcharge item to the cart. In increments existing surcharge item in the cart if it already exists, it adds new country item if it doesn't exists. Removing parent item will also either increments or decrements the surcharge item.I have not tried out his code personally but he assures me that it worked for him when he was fully testing out the process in his environment.
To use descriptive URLs in NetSuite, first, set up a domain at Setup > Web Site > Set Up Domains. Next, turn on the Advanced Site Customization feature, and the Descriptive URLs feature at Setup > Company > Enable Features, on the Web Presence subtab.