How can you get the name of the price level instea...
# suitescript
m
How can you get the name of the price level instead of the internal id?
s
how you are getting the internal id?
t
@mike74 If you want to use SuiteQL, you can do this:
SELECT * FROM ItemPrice WHERE Item = 18
m
I’m using record.getSublistValue
If I use getSublistField, the get the label, it just returns “Price Level” I was expecting it to return the name of the price level
s
getSublistText
m
That just shows the internalid as text
b
what code are you using on what record?
m
Restlet, record load inventory_item
For any given item, I have 10 different price level. Base price, dealer, contract price level etc. I’m trying to get “Base price”, “dealer” but I seem to only can get internal id of the price level
b
load the record in a debugger, and log the record to see what fields you have available
if you can see the name in the ui, there is probably a field for it
m
Another hack I see... that has to be used
s
It's not a hack, the name might not be there on the price sublist, its a pretty special/weird one
b
the probable answer is that netsuite didnt implement the field as a select field
which means it uses another field for the name
m
Haha, there seems to be a lot of these special cases
Thanks guys, guess I’ll have to load the list first to get the name
b
there are multiple ways to see the data you are working with
low effort is adding &xml=T to the url of your record to see what data there is
medium effort is loading the record in suitescript and printing the record's .toJSON form
lower effort extension based approach is the NetSuite Field Explorer
❤️ 1
😁 1
all would give you an idea on which field you should be getting instead of pricelevel
m
Thank you