IR Framework

Limit.setSelection Method

Sets the list SelectedValues for a Limit.
[object.]setSelection (valList)

Arguments

object
Required. A Limit object.


valList
Required. An array or a Limit containing the value(s) to set.


Remarks

If valList is a Limit object, the selection is copied.
The following example uses Limit.setSelection Method to create the values list for a ListBox:

//	Use getSelection to get the list of SelectedValues from a limit
//	then use setSelection to set a selection from the array
if (ActiveDocument.QueryInProcess == "Q-Expenditures") {
	var arr = ActiveDocument.Sections["Q-Budget"].Limits["Region"].getSelection();
	var oTo = ActiveDocument.Sections["Q-Expenditures"].Limits["Region"];
	oTo.setSelection(arr);
}

//	Use setSelection to set a selection directly from another Limit
if (ActiveDocument.QueryInProcess == "Q-Expenditures") {
	var oFrom = ActiveDocument.Sections["Q-Budget"].Limits["Region"];
	var oTo = ActiveDocument.Sections["Q-Expenditures"].Limits["Region"];
	oTo.setSelection(oFrom);
}

Requirements

ActiveDocument.loadObjectMethods() must be called after the limit object is created and before this object method is used.
If valList is a column object, ActiveDocument.loadObjectMethods() must be called after the column is created.