Hi guys
I am trying to apply a prefilter on form load to filter the ISVApplication lookup by Country and worldwide (true). If I set one condition ie Wordwide = 'T' the prefilter works fine but as soon as I add in another condition no records are returned.
I have been struggling with this for a while now, any help would be greatly appreciated.
I have the following code:
Sage.Entity.Interfaces.ITPThirdPartyAssociation assoc = this.BindingSource.Current as Sage.Entity.Interfaces.ITPThirdPartyAssociation;
object parent = this.GetParentEntity();
if (parent is Sage.Entity.Interfaces.IAccount) { assoc.Account = (Sage.Entity.Interfaces.IAccount)parent; }
string sCountry = assoc.Account.Address.Country.ToString(); textbox1.Text = sCountry;
Object[] myObjArray = new Object[1];
myObjArray.SetValue(assoc, 0); ISVApplication.LookupExclusions = myObjArray; ISVApplication.LookupPreFilters.Clear();
LookupPreFilter pf = new LookupPreFilter(); pf.CondOperator = "Not Equal To"; pf.PropertyName = "Worldwide"; //pf.FilterValue = "%' AND (assoc.TPISVApplication.Countries like '%" + sCountry + "%' OR assoc.TPISVApplication.Worldwide = 'T') AND 'A' != 'B"; pf.FilterValue = "XXX' AND assoc.TPISVApplication.Worldwide = 'T' AND 'A' != 'B"; pf.PropertyType = "System.String"; ISVApplication.LookupPreFilters.Add(pf); |