I feel like I always get stuck on this question. ...
# suitescript
j
I feel like I always get stuck on this question. If I check the “type” of a transaction record, I get something like “Opprtnty”. If I need to DO something to that record, e.g. record.submitFields, I need to use record.Type.OPPORTUNITY. How do I convert between the two? Why aren’t they consistent?
n
lookup works with search.Type.TRANSACTION so I believe submitFields should work too. But you are right, there are inconsistencies in transaction. For example, if you want to do a applyingTransaction.type filter, it will be passed as VENDCRED for vendor credit. Did you try result.recordType?
a
good question... I don't really ever come across the weird "Opprtnty" style that often, I know they exist, and I low key hate them. just looking at the Opportunity record there are...
recordType  "opportunity"
and then bodyfields
baserecordtype  "opportunity"
dbstrantype  "Opprtnty"
type  "opprtnty"
as for the module.Type.RECORD syntax, that literally just maps to the recordType, so you can use the string from record type (not the weird one from dbstrantyep)
☝🏻 1
this is in the SS2.0 record.js