It should be closer to this:


// *store the current selection with
var values1 = form.getValues("ADGroupList");

// *run the query and save the results to the picklist
IDVault.globalQuery( "ADGroupList", "InternalResourceCustomQuery",
{"internalad": form.getValue("ADGroupSearch")});

// *add the saved selection
field.setValues("ADGroupList", values1, true );

*restore the old selection with form.select( "ADGroupList" ..)
field.select( values1 )


Wolfgang


On 12.07.2012 23:56, lvaradha wrote:
> AGGroupList (dual picklist)
> //adgrpsearch
>
> *store the current selection with
> form.getValues("ADGroupList")
>
> *run the query and save the results to the picklist with
> form.setValues( "ADGroupList" .. , false )
> // Query
> var queryresult =IDVault.globalQuery("ADGroupList",
> "InternalResourceCustomQuery",
> {"internalad":form.getValue("ADGroupSearch")})
> field.setValues("ADGroupList",queryresult,false)
>
>
> *add the saved selection with form.setValues( "ADGroupList" .. , true)
> field.setValues("ADGroupList", field.getValues(),true)
>
> *restore the old selection with form.select( "ADGroupList" ..)
> field.select(ADGroupList)