Hi all, wondering if anyone can help me with a pri...
# suitescript
a
Hi all, wondering if anyone can help me with a pricing search? I can't seem to find good documentation on it and for some reason this search isn't pulling up any results.
Copy code
var itemSearch = search.create({
                                            type: search.Type.PRICING,
                                            filters: [
                                                ["internalid", "anyof", itemToValidate.internalId],
                                                "AND",
                                                ["pricelevel", "anyof", "6"]
                                            ],
                                            columns: [{
                                                name: 'internalid'
                                            }, {
                                                name: 'unitprice'
                                            }]
                                        });
s
Create the search in the UI, then export to script with the chrome extension.
a
I tried 😞 Pricing search exports aren't supported
s
Copy code
let itemSearch = search.create({type: search.Type.PRICING, filters: [], columns: ['internalid', 'unitprice']}).run().getRange(0,100).map(s => s.toJSON())
that as an example does indeed run and has results
have you logged
itemToValidate.internalId
, where is that coming from
a
Yes, itemToValidate.internalId is pulling the correct item id.
s
is price level 6 filled out on that item? It will have no results if it isnt
a
Yup, it's filled out...
s
There is nothing inherently wrong with the search, I just ran that search that I pasted in the console, and it worked fine
well actually, it does seem like the criteria is breaking, pricing is not supported via suitescript, and this is probably why
a
Just figured it out! It needs to be iteminternalid.
s
yeah the internalid should be
1,2,3,4,5,6,etc
a
Because it's a pricing search, internalid pulls up the price level, not the item.
Thanks for your help.