RE: Item search returning incorrect value
I’m currently working on a Suitelet script in SS2.0 and am encountering an issue with returned search values. I’ve seen the same issue before in SSP, assumed it was a bug and simply worked around it – but wouldn’t expect to see the same with a regular Suitescript release.
I have an item saved search set up in the UI, which includes the column “Name”. This works fine and returns our product’s item code.
If I load the same search in SS2.0, result.getValue(‘itemid’) is returning the value from storedisplayname instead.
I tried dumping a JSON.stringify on the search result and the raw search output displays the same issue – and doesn’t contain the item code anywhere.
Is there some quirk to item searches I need to know about?
Though not entirely related to this, I ran into an issue with a Summary saved search NOT returning the same results in script than in the UI. Turns out the issue was the “Filter By” option. This was set to Order Type, but the transaction search was running on only Journal Entries for specific accounts. Oddly, this resulted in only a few rows not returning data in script tho returning data in the UI.
Hope this helps someone in the future!
can you post your item saved search code? just tried in a demo account and am getting the expected result here.