RE: Field Type List/Record

Hi All, Hope you guys are doing well.

Can I show Save Search result in Field Type List/Record. like Field list show only those record that are present in save search. I try Saved Search Exceptions Mapping that allow me to select one save search using Sourcing/Filtering by id or Save Search name. but didn’t shows any result.

Atif Rookie Asked on May 19, 2023 in Saved Searches.
Add Comment
2 Answers
function dropdownFrmSavedSearch(savedSearchId, dropdownFieldId) {
varsearchObj = search.load({
id: savedSearchId
});
varsearchResult =searchObj.run();
varallResults =searchResult.getRange({ start: 0, end: 1000 }); // Set the range to retrieve all results (up to 1000)
vardropdownValues =allResults.map(function(result) {
return {
value:result.id,
text:result.getValue({ name: 'your_display_field' }) // Replace with the field you want to display in the dropdown
};
});
varfield = currentRecord.getField({ fieldId: dropdownFieldId });
field.addSelectOptions({
value: dropdownValues
});
}

 

You can also use for loop instead of “Map”

Rookie Answered on May 26, 2023.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.