Discussions
Script error - Record type mismatch
We're trying to create a basic, item specific, pop up alert when certain items are selected on a Sales Order. This involves two custom fields on the item record, a check box and text field. If the box is checked, the custom text is displayed in a pop up box.
The script below fails with a SSS_record_type_mismatch' error, when anything other than a 'Inventory Item' is selected:
function myValidateLine(type)
{
var itemID = nlapiGetCurrentLineItemValue('item', 'item');
var itemRec = nlapiLoadRecord('inventoryitem', itemID);
var isChecked = itemRec.getFieldValue('custitem1');
var alert_information = itemRec.getFieldValue('custitem2');
if (isChecked == 'T'){
alert (alert_information);