back to top

Web Client Lookups with Multiple Conditions in Infor CRM (Saleslogix)

Back in the LAN client, there was a way to add multiple conditions to a lookup control, as long as you knew how to manipulate the Lookup properties to your advantage.

The web client’s lookup control is of course a different animal that now uses an SData feed to perform the lookup based on conditions. There is a pre filter property of the lookup control but you are very limited there in picking single conditions.

There is a way of doing this though by manipulating the lookup control itself. You can do so on a load action of a quick form using a C# snippet. Lets look at how you could add multiple conditions. Again by using the various attributes of the lookup control we can construct a valid SData query that will allow multiple conditions.

Let’s say we are in an Opportunity and want to show a lookup (called lookupProduct) to all Opportunity Products that are active and in the current opportunity, or some other criteria. We can use the following code to accomplish this:

    Sage.Entity.Interfaces.IOpportunity opp = this.GetParentEntity() as Sage.Entity.Interfaces.IOpportunity;
    if (opp != null)
    {
        string prods = string.Empty;       
        foreach(Sage.Entity.Interfaces.IOpportunityProduct op in opp.Products)
        {
            prods += string.Format("\"{0}\",", op.Product.Id);
        }        
        lookupProduct.SeedProperty = "(Status";
        lookupProduct.SeedValue = "Active\" and Id in (" + prods + ")) or \"A\" eq \"B";             
        lookupProduct.OverrideSeedOnSearch = false;
    }

We look through and construct a quote enclosed string of the Opportunity Products in the Opportunity.
Then we set the SeedProperty of the control to “(Status”. We add the ( in front of the property to handle the or clause logic later.
Then we set the SeedValue to the rest of our conditions. We include a quote after our first value and before our last value, because when the SeedProperty and SeedValue are appended together an opening quote and closing quote are added automatically.

With these 2 attributes, when the lookup is rendered and used, a query condition is constructed that looks like:

(Status eq "Active" and Id in ("123","456","etc.")) or "A" eq "B"

Remember this is an SData query so this is the where clause in the SData query language.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

3 COMMENTS

  1. Kris,
    Can I put textbox names in for conditions and have the conditions be based on what they user inputs?

  2. THE USER!!! They should have an edit option on the comments for people like me who are in a hurry and make mistakes!

    • Xena you could use the value from another control to pass into the conditions. So something like:

      lookupProduct.SeedValue = “Active\” and SomeField eq \”” + SomeTextControl.Text + “\”) or \”A\” eq \”B”;

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos