hi all. I'm a developer / data guy. My company pul...
# general
m
hi all. I'm a developer / data guy. My company pulls NS data out of the API and into Snowflake tables using a replication tool. I need to query it. Currently I'm working on a query against Customers that needs to include who created the customer record. I have figured out that this will come from the SYSTEM_NOTES table and will need to join to the NOTETYPE table. I know I need to filter on the OPERATION field to look for Created. The problem is the final link, which is from SYSTEM_NOTES to CUSTOMERS. There are fields called RECORD_ID and RECORD_TYPE_ID on SYSTEM_NOTES. I assume RECORD_ID is the ID of the linked record and RECORD_TYPE_ID indicates whether it's a customer, vendor, etc. Unfortunately, what I can't find is a table that corresponds to RECORD_TYPE_ID or any documentation of what the values mean. So I don't know how to filter for customers. Can anyone point me in the right direction to figure this out?
a
I'm more functional than dev/data lol so for me, I'd have a "created by" field store value on all transactions. For the existing ones, I will do a search to find the author, and csv import to fill that author in the "created by" field for all existing transactions. Then I'd also create a workflow to auto-populate the "created by" to whoever hit the "save" button, for all future transactions. In that case I worry less about those joins etc.
m
thanks April. I'd like to try to use the existing functionality rather than go build all that extra stuff, though. what I really want is to know what all the record types mean in case we need to use it again in the future.
a
gotcha. If I remember right, the record type ID is the circled "internal" ID for each record type when you go to the record browser: https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/script/record/salesorder.html
r
customization - > lists -> record types, to see internal ID for each record type you have
for native ones this list may help you
m
@April Wu unfortunately, the value on the Record Browser is a text string and I need the numeric ID
r
numeric ID is in link i sent
m
@Rob Cady yep, I was about to respond to you
👍 1
@Rob Cady so your first message first: I don't think that's the same record type I need. I don't see customer listed, for example. I also don't see an Internal ID. on your next two messages, that seemed more promising until I looked at the IDs listed there: they are all negative numbers. most of the record_type_ids in my SYSTEM_NOTES table are positive. and even if we ignore the sign, there are only 10 total entries in the table for Customer if we assume that list is correct and Customer is represented by 2. so I don't think we're quite there yet, but I very much appreciate the effort.
r
you have to turn on show internal IDs in set preferences to see them in first message
set preferences - general - defaults - show internal IDs
message has been deleted
m
ok, got it on the internal ID. but customer is still not showing up in the list. do I need to do something to see entities of that type?
r
I believe that list is for non native record types, for example custom ones or ones from a bundle
m
oh ok. can I see that for native types?
r
Give that blog post a read may point you into the right direction
m
ok will do
thanks again
r
I think -2 is what you want to use for customer record type ID
NetSuite uses negatives for alot of it's native internal IDs.
another example where NS uses negatives here.
I've seen this all over the place looking at internal IDs
m
yeah but notice this: I queried the table grouping by record_type_id to get the counts of how many times each record_type_id appears in the table. this list is sorted by record_type_id. there are no -2s.
r
I wonder if it's unique for each environment
m
that seems inefficient but likely
r
found another suite ID that says the same thing, -2.
except this one is from 2020, not 2011 like first one
m
huh. either it's environment-specific or there's something wrong with our environment
we're working with our consultant on this. I'll let you know what I find out.
👍 1