Discussions
Does not work, why ? (custom code on FORM)
The following works:
------------------------------------------------------------
else if (name == 'custrecord_commuter_student')
{
var recordID = nlapiGetFieldValue('custrecord_commuter_student');
var record = nlapiLoadRecord('customer',recordID);
var addressbookCountry = record.getLineItemValue('addressbook','country',1);
nlapiSetFieldValue('custrecord_commuter_country', addressbookCountry);
}
-------------------------------------------------------------
But I changed the RED to the following, but it does not work. WHY?
-------------------------------------------------------------
else if (name == 'custrecord_commuter_student')
{
var recordID = nlapiGetFieldValue('custrecord_commuter_student');
var record = nlapiLoadRecord('customer',recordID);
var addressbookCountry = record.getLineItemText('addressbook','country',1);
nlapiSetFieldValue('custrecord_commuter_country', addressbookCountry);
}