```var salesOrderSearch = search.create({ type:...
# suitescript
c
Copy code
var salesOrderSearch = search.create({
   type: search.Type.SALES_ORDER,
   columns: [
      {name: 'internalid'}
   ],
   filters: [
      ['otherrefnum', <http://search.Operator.IS|search.Operator.IS>, PURCHASE_ORDER_TRANSACTION_ID]
   ]
});
I have this super simple search here in code that looks for Sales Orders that have the otherrefnum of what I am specifying (PURCHASE_ORDER_TRANSACTION_ID). No matter what the value of PURCHASE_ORDER_TRANSACTION_ID is, it always returns the exact same Sales Order which definitely does not have the same value. Its as if the filter isn't working but its a text field so this should have no issues....is there just something stupid I am not seeing?
b
otherrefnum corresponds to the PO/Check Number which is a number in the ui
m
maybe try search.Operator.EQUALTO because.. reasons?
b
use poastext (which is PO/Check ID) if you want to treat it as text
c
im looking at all of their sales orders now and they have text ill try equal to though
b
fields and filters are not the same thing
there is a difference between otherrefnum on a record and otherrefnum as a filter
take a look at the PO/Check filters in the transaction search ui
c
equalto fixed it...i feel stupid now lol
(thank you)
m
if it helps i had zero justification for suggesting it (other than NS being netsuite )
c
it def worked... i just failed today...it happens. Im not sure why equalto wasnt even popping up in my brain
embarrassing yourself will help you not forget it next time :p
s
I thought I read somewhere that EQUALTO was for strings or not?
vs IS
c
help doc has a table of which operators work with data types and is works with strings according to that
but equal to is the correct way apparently
p
I would normally try creating the saved search equivalent in UI to see what is happening.