I haven't had any training on scripting BUT I'm happy to say that i have a week training set up very soon so hopefully these beginner level questions can be answered. That being said, I have to have this script complete and I thought I had it figured out but I'm definitely missing something. What I'm trying to do is set the custom form field in the sales order based off a custom field in the customer record after a customer is entered on the sales order. Here's what I have:
function checkCustomerForm(type, name)
{
if(type =='create')
{
var FormType = nlapiLookupField('customer',nlapiGetFieldValue('entity'), 'custentity6');
{
If (FormType = 'Schlage Forms')
{
nlapisetFieldValue('customform','119');
}
}
}
}
My explanation:
custentity6 is the custom field in the customer record that is a drop down list of either XceedID Forms or Schlage Forms. If the latter is in the customer record, I want to use a non preferred form which is internal ID 119. If it is the former I don't think we need to do anything because the preferred form will be the default. This is the error message:
Error: JS_EXCEPTION
ReferenceError checkCustomerForm is not defined
Thank you so much in advance for your help with this! You guys are always so great with helping my issues!