Fixing lookup restrictions the SalesLogix 7.5.1 LAN Complete History screen

 

In the SalesLogix LAN client there is a bug where the Opportunity and Ticket lookups are not correctly restricting to only showing records associated to the selected Account.

SalesLogix 751 History screen

On the complete History screen in the SalesLogix LAN client you would expect that if you have selected a Contact/Account that when you did a lookup on the Opportunity or Ticket fields it would restrict to show only records associated to the selected Account.  This is how earlier versions behave (like 7.2.2).

 

If you look into the code you can see that on both of the Opportunity and Ticket lookups there is an event called OnOppTicketPopup tied to the OnPopUp event.  This code looks like this:

Sub OnOppTicketPopup(Sender)
    Sender.LookupRestrictValue = lveAccount.LookupID
End Sub

Normal enough, and you would think that it would perform the task of restricting the lookups.  Problem is, neither the Opportunity or Ticket lookup controls have any of the other Lookup Restriction properties ever set.

A lookup control requires 4 properties to be set in order for the lookup to be properly restricted:

  • LookupRestrictAlways
  • LookupRestrictField
  • LookupRestrictOp
  • LookupRestrictValue

We can fix the problem of them not correctly filtering the lookups by simply setting these properties correctly for both controls.  Now you have two options for this, you can set these properties up at design-time for both controls or you can add code to do that at run-time.  I will choose the run-time approach because I only have to set the properties once in code, rather than repeat them for both controls.

Here is the code with the correct attributes also set:

Sub OnOppTicketPopup(Sender)
    Sender.LookupRestrictAlways = True
    Sender.LookupRestrictField = “ACCOUNTID”
    Sender.LookupRestrictOp = ” = ”
    Sender.LookupRestrictValue = lveAccount.LookupID
End Sub

A simple fix.  I am attaching a bundle with this already done.  Please note that the bundle uses the standard 751 version of the plugin as its base.  If you have customized this screen you would want to manually add the code above to your custom screen.

ABOUT THE AUTHOR

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!