This topic contains 6 replies, has 0 voices, and was last updated by reecemak 6 years, 6 months ago.
-
AuthorPosts
-
April 6, 2018 at 11:28 am #18060
vkwanengageHi everyone. Fairly new to NetSuite SuiteScript 2.0 so please bear with me. I am trying to search for Inventory Items that uses a custom record type. I was wondering using the N/search module,
a) Is there any way to return a sublist in the columns attribute
b) Is there a way to filter on a sublist
Or do I have to get all the Inventory Items and go record by record to check if they have a sublist lineitem?
Thanks.
This is a cached copy. Click here to see the original post. -
April 6, 2018 at 12:02 pm #18061
jsheplerI’m new and learning stuff too, and am interested in how to construct such a search.
One option might be to use a saved search. If you can craft a saved search in the UI (lists / searches / saved searches) that does what you want, you can run that search from code.
-
April 9, 2018 at 11:24 am #18062
vkwanengageThanks jshepler…
I checked out the Saved Searches Page…. Looks like you can only filter by fields of that particular Record Type I don’t see an option to filter by a sublist/subrecord
-
April 9, 2018 at 2:32 pm #18063
jsheplerThe drop down includes related records at the bottom in the form “XX fields…” and when you select that, you get a popup that then lets you select fields from that record type.
-
April 9, 2018 at 2:45 pm #18064
MChammaTXOriginally posted by jshepler
View Post
The drop down includes related records at the bottom in the form “XX fields…” and when you select that, you get a popup that then lets you select fields from that record type.
You are correct. You can use joins in SuiteScript to your custom record. The column format is something like {name:’customrecord column name’, join:’field id of custom record’}
-
April 9, 2018 at 3:04 pm #18065
vkwanengageThanks for all the help…. I figured out a different approach.. Instead of filtering by a sublist i went the other way around.. Search by the custom record type (which would have been the sublist) and getting the record type id that it is associated to and query that instead…
But this has been great help. Thanks everyone
-
April 23, 2018 at 6:02 pm #18066
reecemakI think you need to use ‘join’
-
AuthorPosts
You must be logged in to reply to this topic.