I need to be able to check when a vendor price is changed to see if the Sale Units and the Purchase Units are different.
If the sale unit do not match the purchase unit, I need to convert the vendor price (purchase units) to how we sell the item (sale units) and then store this value in a custom field without affecting the actual purchase price.
Seems simple right...
I retrieve the sale unit, purchase unit, and vendor price using: var theSaleUnit = nlapiGetFieldValue('saleUnit');
Then I attempted to use this mess...
var fields = ['baseUnit', 'conversionRate', 'name', 'unitName', 'internalId']
var columns = nlapiLookupField('unitstype', theSaleUnit, fields);
var theBaseUnit = columns.baseUnit;
var theConversionRate = columns.conversionRate;
var theName = columns.name;
var theUnitName = columns.unitName;
var theInternalId = columns.internalId;
Needless to say, this crashed and burned and I don't know how to achieve my simple conversion. Has anyone encountered something like this before and could show me my error in this logic
thanks
dale