1

Can someone help me to get the item color and size of specific item. I got the id of item called "custcol_coloroption" with value of 8. how can i translate that to value Ex. Black,White and etc. Thank you

user3627301
  • 21
  • 3
  • 10
  • Could you please tell me how did you get this `custcol_coloroption` internal id. can you provide some code snippet. It doesn't seem to be a matrix field. I suspect it is a transaction column field. – Rockstar May 19 '15 at 09:28
  • @Rockstarvar ir = nlapiLoadRecord('itemreceipt',id); ir[0].getLineItemValue('item', 'custcol_coloroption', 1); – user3627301 May 19 '15 at 09:33
  • @Rockstar Here's some info of item. countryofmanufacture: "PE" currency: "USD" custcol_coloroption: "8" custcol_columnforcolor: "8" custcol_columnforsize: "1" custcol_item_type: "1" custcol_size: "1" – user3627301 May 19 '15 at 09:34
  • I assume `ir[0].getLineItemValue('item', 'custcol_coloroption', 1);` returns you a value of `8`. You also can use `ir[0].getLineItemText('item', 'custcol_coloroption', 1);` to get the text value associated with that attribute. – Rockstar May 19 '15 at 09:38
  • @Rockstar It throws error TypeError: Cannot read property 'nlapiGetLineItemText' of undefined – user3627301 May 19 '15 at 09:44
  • @Rockstar i mean TypeError: Cannot read property 'getLineItemText' of undefined – user3627301 May 19 '15 at 09:47
  • BTW I think you're loading a single record so no need of `ir[0]` :) have a good day! – Rockstar May 19 '15 at 09:55

1 Answers1

1
var ir = nlapiLoadRecord('itemreceipt',id);
var attributeid = ir.getLineItemValue('item', 'custcol_coloroption', 1); // returns you the id
var attributename = ir.getLineItemText('item', 'custcol_coloroption', 1); // returns you the text associated with that attribute
Rockstar
  • 2,228
  • 3
  • 20
  • 39
  • Can i ask other question here, regarding to location of item? – user3627301 May 19 '15 at 09:59
  • Its better to create a separate thread rather mixing up all together. ;) – Rockstar May 19 '15 at 10:00
  • Most likely correct.. You have to make sure in Netsuite you work with Text and Value of a record. The value is what Netsuite uses and the text is the label hanging to it. So in user3628301's case, the value would be 8 and the text "black" (or whatever text is in there). – Malachi May 19 '15 at 17:00