Reputation: 353
I'm using NetSuite Cases in order to provide internal support cases for our company. I have a custom case form that still has the Company field on the form. I simply want to default this required field to our company.
I've created a simple .js file with the following function:
function setCompany(){
nlapiSetFieldValue('company', <our company>);
}
where is the value for the field.
I then, in our custom case form, under the Custom Code sub-tab I have my file name and for the Page Init Function I have "setCompany". I can't seem to get the field to set.
Ideas?
Upvotes: 3
Views: 4011
Reputation: 915
Both can be used on server and client. nlapiSetFieldValue will set the value of the of the field in your case if you are trying to set the company field you should use nlapiSetFieldValue('company', 1000) wherein 1000 is the internalid of the company. Now if you dont know the internalid and you just know the name of the company you can use nlapiSetFieldText('company', 'My Company').
Upvotes: 3
Reputation: 353
Literally found the answer immediately after making this post.
function setCompany(){
nlapiSetFieldText('company', <value>);
}
nlapiSetFieldValue is server side...nlapiSetFieldText is client side.
Upvotes: 3