This topic is locked

Search Panel - how to programmatically set multiple selections using Search API

5/19/2021 4:20:46 PM
ASPRunner.NET General questions
FrankR_ENTA author

I'm using the Search API code below to set a selection of a Lookup dropdown list in the search panel of a List page. The Lookup is set up for multiple selections, and manually, I can make multiple selections.
But when the List page is first displayed, I need to programmatically set multiple selections. Is there a way to do it?

dynamic srchObj = SearchClause.getSearchObject("Purchasing Tickets");
dynamic value = srchObj.getFieldValue("pts_status_id");
if( value == null ) {
srchObj.setFieldValue("pts_status_id", 1);
//srchObj.setFieldValue("pts_status_id", 2);
//srchObj.setFieldValue("pts_status_id", 3);
}