Posted 4/4/2007 3:37:03 PM | | | | I am trying to use the lookup filter to filter accounts by Relationship Type(customertypecode). I want to just return all accounts that are of type "Broker". However it causes the error "An unexpected error occurred". If I try to apply the filter to a text field, there is no problem. It is only when trying to apply it to a field that is a drop-down that is causes this unknown error. My code is as follows: ILookupFilter objFilter = ControlFactory.CreateLookupFilter(); objFilter.AttributeName = "customertypecode"; objFilter.EntityType = 1; objFilter.Operator = c360.Toolkit.CRM2005.ConditionOperator.Equal; objFilter.Values.Add("Broker"); objTable.Rows[1].Cells[0].Controls.Add(new LiteralControl("Account:")); ILookup objAccountLookup = ControlFactory.CreateLookup(); objAccountLookup.AllowedObjectTypes.Add(1); objAccountLookup.AllowCreateNew = true; objAccountLookup.AllowViewProperties = true; objAccountLookup.LookupStyle = LookupStyles.Single; objAccountLookup.ID = "lookupAccount"; objAccountLookup.Filters.Add(objFilter); objTable.Rows[1].Cells[0].Controls.Add(objAccountLookup.Control); |
| Posted 4/4/2007 5:57:02 PM | | | | It looks likt the problem is that you are using a string value ("Broker") in order to filter an integer field (customertypecode). If I were you, I would figure out the integer value representing the "Broker" value and I would use that value in the filtering. Let me know if this helps.
|
| |
|