I am trying to view transactions, but the `record....
# suitescript
e
I am trying to view transactions, but the
record.Type.TRANSACTION
is undefined. Anyone know why? I am testing this in the debugger btw.
n
Use transaction name like INVOICE
e
Thanks. 🙏
👍 1
s
@Eystein Bye these are the record.Type enums, if you search for record.Type, you'll see these in full glory - this also hints want can or cannot be loaded via the record module!
also as a friendly reminder, if you do context.newRecord.type type here is in minor case as opposed to record.Type enums
e
@Sciuridae54696d I used the "SuiteScript 2.0 API Reference" PDF to find the record.Type enums, but they were not the same I guess.
I still find it a bit hard to use. Like: how do I join the INVENTORY_DETAIL record with the ITEM_FULFILLMENT record. Is there a place where keys are explained ?
s
inventorydetail is a subrecord - i.e. not quite the same as a normal record.
to work with those records you need to learn the subrecord APIs or use NFT that just makes it all easy.
s
Yes @Eystein Bye suitescript is a different beast, the optimisation comes with the search, and you see if you can do the greatest join. the remarch in the sublist will tell you to load the subrecord, that's all, otherwise record side it's about loading the right record and looking at values, more than one value then you should see searches haha
e
Thanks. Btw. How do I know that inventorydetail is a subrecord? And is it a subsrecord of ITEM_FULFILLMENT?
s
not entirely great docs, but because in the record browser it shows the field as a "Summary" field and has a clickable link that takes you to the InventoryDetail record definition. On the InventoryDetail page it says 'subrecord'
e
@stalbert Thank you. This will make my work a lot easier 🙂
s
I find all that to be a bunch of useless cognitive load, which is why NFT represents records, sublists, subrecords and even sublists on subrecords all uniformly - as JS objects and collections of objects respectively.
I don't want to think about changing APIs several times just to work with different flavors of NS data.
🙂
e
NFT Sounds like a much better solution. I will look at it. There is always a cost to switching frameworks also, but NFT might save me that time again 🙂
s
NFT is really a pretty thin layer of code that is similar to what many NS devs keep writing over and over, just done in one cohesive and highly reusable fashion.