Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, June 30, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Lookup PreFilter
Joern Engmann
Posts: 27
 
Lookup PreFilterYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Mar 10 6:25 AM
Hi,

I want to use Prefilter for an existing Address-Lookup in an own Custom Smartpart. The smartpart is on an own entity. The entity has a field "Contactid". I created a child relation (1:M) named ContactAddresses from that field to the entityid field of the address entity.

Control definition:

<div class="textcontrol lookup">
<SalesLogix:LookupControl runat="server" ID="lueSLXAddress" ButtonToolTip="<%$ resources: lueSLXAddress.ButtonToolTip %>"
LookupEntityName="ContactAddresses" LookupEntityTypeName="Sage.SalesLogix.Entities.Address, Sage.SalesLogix.Entities"
EnableHyperLinking="true" InitializeLookup="true">
<LookupProperties>
<SalesLogix:LookupProperty PropertyHeader="<%$ resources: lueSLXAddress.LookupProperties.Address1.PropertyHeader %>"
PropertyName="Address1" PropertyType="System.String" PropertyFormat="None" UseAsResult="True"
ExcludeFromFilters="False">
</SalesLogix:LookupProperty>
<SalesLogix:LookupProperty PropertyHeader="<%$ resources: lueSLXAddress.LookupProperties.City.PropertyHeader %>"
PropertyName="City" PropertyType="System.String" PropertyFormat="None" UseAsResult="True"
ExcludeFromFilters="False">
</SalesLogix:LookupProperty>
<SalesLogix:LookupProperty PropertyHeader="<%$ resources: lueSLXAddress.LookupProperties.Country.PropertyHeader %>"
PropertyName="Country" PropertyType="System.String" PropertyFormat="None" UseAsResult="True"
ExcludeFromFilters="False">
</SalesLogix:LookupProperty>
<SalesLogix:LookupProperty PropertyHeader="<%$ resources: lueSLXAddress.LookupProperties.Description.PropertyHeader %>"
PropertyName="Description" PropertyType="System.String" PropertyFormat="None"
UseAsResult="True" ExcludeFromFilters="False">
</SalesLogix:LookupProperty>
<SalesLogix:LookupProperty PropertyHeader="<%$ resources: lueSLXAddress.LookupProperties.IsMailing.PropertyHeader %>"
PropertyName="IsMailing" PropertyType="System.Boolean" PropertyFormat="None"
UseAsResult="True" ExcludeFromFilters="False">
</SalesLogix:LookupProperty>
<SalesLogix:LookupProperty PropertyHeader="<%$ resources: lueSLXAddress.LookupProperties.IsPrimary.PropertyHeader %>"
PropertyName="IsPrimary" PropertyType="System.Boolean" PropertyFormat="None"
UseAsResult="True" ExcludeFromFilters="False">
</SalesLogix:LookupProperty>
<SalesLogix:LookupProperty PropertyHeader="<%$ resources: lueSLXAddress.LookupProperties.PostalCode.PropertyHeader %>"
PropertyName="PostalCode" PropertyType="System.String" PropertyFormat="None"
UseAsResult="True" ExcludeFromFilters="False">
</SalesLogix:LookupProperty>
</LookupProperties>
<LookupPreFilters>
</LookupPreFilters>
</SalesLogix:LookupControl>
</div>

Filter:

lueSLXAddress.LookupPreFilters.Clear();
Sage.SalesLogix.HighLevelTypes.LookupPreFilter filter = new Sage.SalesLogix.HighLevelTypes.LookupPreFilter();
filter.LookupEntityName = "Address";
filter.PropertyName = "ContactAddresses.EntityID";
filter.CondOperator = "Equal to";
filter.PropertyType = "String";
filter.FilterValue = objCon.Id.ToString();
lueSLXAddress.LookupPreFilters.Add(filter);

Problem is that I never get a prefiltering. Either I see all addresses or non.

Can somebody help me to find out what I'am doing wrong?

Thanks

Joern
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Lookup PreFilterYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Mar 10 10:43 AM
Your prefilter is for an entity that is joined to your "form" entity, not the entity used in the lookup. You need to reference the entity in the lookup to filter it.

So you would need something like:

lueSLXAddress.LookupPreFilters.Clear();
Sage.SalesLogix.HighLevelTypes.LookupPreFilter filter = new Sage.SalesLogix.HighLevelTypes.LookupPreFilter();
filter.LookupEntityName = "Address";
filter.PropertyName = "EntityId";
filter.CondOperator = "Equal to";
filter.PropertyType = "String";
filter.FilterValue = objCon.Id.ToString();
lueSLXAddress.LookupPreFilters.Add(filter);

Remember this is all case sensitive so make sure "EntityId" is the correct property name for it in App Architect.

Thanks,
Nick
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/30/2025 6:29:26 PM