Does anyone know what search.Type.SALES_ORDER is? ...
# suitescript
e
Does anyone know what search.Type.SALES_ORDER is? In the UI, I don't have a saved search option of Sales Order. I would normally do a transaction search and add criteria of type = sales order. Does anyone know if this accomplishes the same thing?
n
SALES_ORDER is a transaction of type SalesOrder and would return those fields / joins etc specific to a sales order rather than the more general "transaction" (as viewed in the records browser)
s
I mean when you make a transaction search in the UI and export to script its like
Copy code
search.create({
   type: "salesorder",
   filters:
   [
      ["type","anyof","SalesOrd"]
   ],
   columns:
e
Hmm that's interesting
s
Removing the filter/criteria, it yields same number of results, so I believe you can remove
type anyof SalesOrd
if you change the
type
property of the search
e
I'll give it a go with both search.Type.TRANSACTION with the filter of type=salesorder and also search.Type.SALES_ORDER and see if there's any differences
s
Probably a risky maneuver, I would probably stick with the type being
transaction
and putting the
type
criteria in personally.
m
If I'm searching for one specific transaction type, I always use the specific
type
option in
search.create()
(e.g.
search.Type.SALES_ORDER
) rather than the
type
filter with the more generic
search.Type.TRANSACTION
and I've never had any issues, but I'd be curious to know if anyone has anything more concrete on whether or not there's a difference between them.
e
I do the same ^. The various transaction subtypes are just there for convenience. They're shortcuts to a search with a
type
of
transaction
and a
type
Filter
👍 2