I'm currently working on a .ss script which we're using within product web pages on our web site. In order to be usable, I'm having to avoid loading full product records, as this leads to seconds of lag. Instead, I'm using nlapiLookupField as per Netsuite's best practice guidelines, but am having an issue getting product itemid value in the SSP context.
If I run nlapiLookupField('inventoryitem','12345','itemid') from the browser console, Netsuite correctly returns the itemid. If I do the same thing in the .ss script, it returns null.
If I run nlapiLookupField('item','12345','itemid'); from the console, it returns the correct result. If I run it in .ss, it returns the item's display name instead.
I've tried every field I can see which might yield the itemid without success, with and without the 4th boolean nlapiLookupField parameter. I can't use nlapiLoadRecord on the ID, as this just results in a useless script which is too slow for it's intended purpose.
Can anyone shed any light on how to get the correct value? The same script is pulling all sorts of values from the product record without any issue and I can't see why the itemid, which is the one field which should be externally visible can't be displayed!
This is a cached copy. Click here to see the original post.