i have two saved searches A and B. i take a value ...
# suitescript
v
i have two saved searches A and B. i take a value from A and with that value i need to search in the B saved search. how can this be achieved?
n
Might need more of an example, but you could potentially get the value you want from A and then load and update the criteria of B
Copy code
let searchB = search.load({id: 'B'});

let bDefaultFitlers = searchB.filters;

bDefaultFitlers.push("AND", ["fieldId", "anyof", "valueFromA"]);

searchB.run().each(result => {/*do something*/});
Alternatively you could just run both searches, create objects from the results, then use the value of A to pull back the value of B
Copy code
let searchAResults = {fieldToFilterOn: 1234}
let searchBResults = {1234: 'valueYouWant', 5678: 'otherValue'}

let resultYouWant = searchBResults[searchAResults.fieldToFilterOn]
s
Another option may be a SuiteQL search that uses SQL joins to pull the information for both A and B simultaneously.
this 1
n
Shawn's option is definitely the cleaner route if you have the time to rebuild your searches. I would only use the options i mentioned if you absolutely have to use the searches.