On a request form I have two fields:
- a dn, DNLookup
- a string, PickList (two lists)

When an object is selected in the DNLookup I have an onChange which fires "gotUser" with customData = the selected object.
The Picklist has an onLoad which fills the list with selectable objects, and a script that runs on "gotUser" which selects some of the objects.

My problem is that when the field.select() is done on the PickList field it rusults in an onChange on the DNLookup field, which then fires the event and --> endless loop.

onChange on DNLookup:
Code:
val = 'not enroled';
if (field.getValue() != undefined && field.getValue() != '' && field.getValue().length != 0)
{
	roles = RoleVault.getRolesUserIn(field.getValue());
	for (i=0; i<roles.size(); i++)
	{
		if (roles.get(i).indexOf('acccard',0) > -1)
		{
			field.fireEvent('gotuser',field.getValue());
			val = 'enroled';
console.log('fire')
		}
	}
	field.fireEvent('enrolement', val);
}
gotUser on PickList:
Code:
var grparr = [];
grps = IDVault.get(null, event.getCustomData()+'', 'easyIDMUser', 'GroupMembership');
for (var i = 0; i < grps.length; i++)
{
	console.log(i)
	if (grps[i].indexOf('lenelAccLvl') > -1)
	{
		grparr.push(grps[i]);
	}
}
if (grparr != undefined && grparr[0] != '' && grparr != '')
{
	field.select(grpsarr);
}
IDM AE 4.5.5
Tested in IE, FF and Chrome