Christian Bannard
02/22/2023, 6:07 AMDavid B
02/22/2023, 8:28 AMDavid B
02/22/2023, 8:34 AM{'item', 'anyof', ...[_arrayofitemids_]}
jv
02/22/2023, 8:54 AMChristian Bannard
02/22/2023, 9:01 AM{'item', 'anyof', ...[_arrayofitemids_]}
part of it? I think that might also be the right approach though how would I put this into an array to search? Would you split each result row into separate fields, extract the locationId
to match the item record against the receivinglocation
of the inboundshipment
the use the rest of the information after the matching is done?David B
02/22/2023, 9:06 AMChristian Bannard
02/22/2023, 9:10 AMDavid B
02/22/2023, 9:11 AMDavid B
02/22/2023, 9:20 AMN/query
Assuming that the table names areandsales_orders
and they have columns namedinbound_shipments
,location
,item
, andquantity
, the PL/SQL query for NetSuite that joins the two tables and matches the location and item on each table can be written as:order_number
Christian Bannard
02/22/2023, 9:22 AMChristian Bannard
02/22/2023, 9:22 AMChristian Bannard
02/22/2023, 9:28 AMChristian Bannard
02/22/2023, 9:31 AM// Define the inner saved search (nested search)
var nestedSearch = search.create({
type: 'customer',
filters: [['internalid', 'anyof', '123', '456']],
columns: ['internalid', 'companyname']
});
// Define the outer saved search
var outerSearch = search.create({
type: 'invoice',
filters: [['mainline', 'is', 'T']],
columns: ['internalid', 'tranid']
});
// Add the nested search as a subquery in the outer search
var sublist = outerSearch.createSublist({
name: 'customers',
join: 'customer',
search: nestedSearch
});
// Add columns from the nested search to the outer search
sublist.addColumn({
name: 'internalid',
join: 'customer'
});
sublist.addColumn({
name: 'companyname',
join: 'customer'
});
// Run the search
var searchResults = outerSearch.run();
Christian Bannard
02/22/2023, 9:33 AMsearch.create()
method, just as you would for any other saved search. This saved search will be the nested search that will be used as a subquery in the outer search.
2. Define the outer saved search using the search.create()
method. You can use the search.createFilter()
method to add filters to the outer search.
3. Use the search.createColumn()
method to add any columns that you want to retrieve from the outer search. You can also use the search.addColumn()
method to add columns from the nested search that you want to retrieve.
4. Add the nested search as a subquery in the outer search by using the search.createSublist()
method. This method takes the nested search as its parameter and adds it as a sublist to the outer search.
Example was the code aboveDavid B
02/22/2023, 9:34 AMDavid B
02/22/2023, 9:34 AMChristian Bannard
02/22/2023, 9:35 AMDavid B
02/22/2023, 9:36 AMChristian Bannard
02/22/2023, 9:38 AM