This topic contains 1 reply, has 0 voices, and was last updated by david.smith 7 years, 1 month ago.

  • Author
    Posts
  • #21519 Score: 0

    dominicb
    • Contributions: 0
    • Level 1

    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.

  • #21520 Score: 0

    david.smith
    • Contributions: 0
    • Level 1

    Best practice would be to search only once for all your values. The issue with null might stem from a role permission issue. Check your role setup when accessing from the site.

You must be logged in to reply to this topic.