Programmatically setup lookup filter

May 11, 2009 at 10:25 PM

Has anyone programmatically setup a the filtered lookup parameters. If so, can you direct me towards a resource?

Coordinator
May 12, 2009 at 3:06 PM
Edited May 12, 2009 at 3:07 PM

Please see my blog post for an example on this subject; I hope you find it useful.

 

Regards,

Raphael.

May 28, 2009 at 9:25 PM

Do you have an example where you setup the filtered lookup base off of a view? What dll has the "FilteredLookupField" datatype? 

Regards,

Jagun

Coordinator
May 31, 2009 at 6:50 AM

Hi Jagun,

I'm not sure I understand the question.

The blog post I referred to in my previous comment shows how to create the FilteredLookup field programmatically.

You could either use:

1. A query filter by specifying the query and assigning a value to the "QueryFilterString" property of the field instance or

2. A list view filter by identifying the list view you want to use and assigning the value of ID property of the view (this should be a GUID) to the "ListViewFilter" property of the field instance.

NOTE: Do not set both properties at the same time. If both properties are assigned values at the same time for a given instance, the "QueryFilterString" property takes precedence.

Please let me know if I've missed out anything or if you've got further questions.

 

Regards,

Raphael.