Auto-fill by client script a select2 field

Hello,

Can anyone provide a functional example on how to pre-fill a select2 value without manually selecting it?

I want to filter a list of options on a field by a GET param; this is fine, we filter the options in Lookup_Selecting by checking the parameter and filtering the query of the associated view (e.g. Param("AssetID"))

My issue is that, since the list of options are async (loaded dynamically), there is no way I can automate the process.

Does anyone has an working solution?

You can use the Row_Rendered server event to load the options and set the selected value.

1 Like