Hello :wave:, I’m having a really hard time to bu...
# suitescript
b
Hello 👋, I’m having a really hard time to build a query which was supposed to be quite simple, my goal is to fetch all open bill credits, in order to do that, I’m using as a reference the fields available here, so I identified that either
applied
or
unapplied
should be used, e.g:
Copy code
const creditMemo = search.create({
        type: 'vendorcredit',
        filters: [
            ['applied', search.Operator.EQUALTO, 0],
        ],
        columns: ['internalid','custbodyenquiry_id', 'trandate', 'name']
    });
However, it does not matter the combination that I use, I’m always getting the following error
SSS_INVALID_SRCH_FILTER
. Does anyone have any clue how to achieve this?
b
thats the approach of someone who doesnt know how to build the search in the ui
🙄 1
learn how to build the search in the ui first, then come back after you learn that a vendor credit is not represented as a record in a search
👎 1
🙄 1
r
Create the search in the UI. There is a chrome extension export saved search. With which you can get the 1.0 or 2.x code.
b
Solved, posting the answer below in case someone needs help in future with a similar problem, also with relevant links. First of all, thank you for the pro-tip of Saved Search Export Plugin, @raghav. The approach that I was already doing was to build in UI first and then manually build the search using another plugin, namely Netsuite Field Explorer, which allows me to see the fields (image below), your suggestion was a game changer though as not all searchable fields are visible, such as`amountremainingisabovezero.` The problem was not the
vendorcredit
type!! Your plugin allows me to understand that I should use`amountremainingisabovezero` field instead of
unnaplied
or
applied
Snippet with the code that works for me
Copy code
const vendorCredit = search.create({
        type: "vendorcredit",
        filters: [
                ["type","anyof","VendCred"],
                ["amountremainingisabovezero","is","T"]
        ],
    });
🙌 1
👀 1