Infor CRM 8.3.06 Proximity Search Sorting Error

In the web client there is now a proximity search to find records within a specified distance of one another.

There are 2 proximity searches- one for account and one for contacts.
This functionality is in 2 custom smart parts both in the ProximitySearch folder:

ContactDistanceSearch.ascx
AccountDistanceSearch.ascx

Searching on the Contact version has a problem if you try to click on the column headings of either Contact or Account to sort the grid after results are returned.

The Contact and Account fields are defined as ASP.Net TemplateFields in the data grid. They have a sort expression of “Contact” and “Account” respectively.This means that in the underlying data source that the grid is bound to, it is looking for a property called “Contact” and and a property named “Account”

The underlying data source is populated by a SQL query:

select
contact.contactid as id, Round( {LatLongFn(lat, lon)}, 2) as Distance, account.Account as accountname,
account.AccountId, Address.Address1, Address.City as City, Address.State as State,
Address.PostalCode as PostalCode, contact.WorkPhone MainPhone, contact.Type, contact.Status, namelf,
g.GPSLATITUDE as Latitude, g.GPSLONGITUDE as Longitude,
Address.Address1 + ‘ ‘ + Address.City + ‘ ‘ + Address.State + ‘ ‘ + Address.PostalCode as DisplayAddress,
ISNULL(u.LASTNAME, ”) + ‘, ‘ + ISNULL(u.FIRSTNAME , ”) as AccountManager, Address.AddressID as AddressId,
CASE WHEN g.SOURCE IS NULL OR g.SOURCE = ‘Initial’ OR g.SOURCE = ‘PostalCode’ THEN 0 ELSE 1 END AS GEOCODED
from contact inner join account on account.accountid=contact.accountid inner join Address on contact.addressid = address.addressid
left join USERINFO u on u.USERID = contact.ACCOUNTMANAGERID
LEFT JOIN SSSGEOCODEDADDRESS g ON address.ADDRESSID = g.ADDRESSID

Then it adds “where” conditions in as well.

Notice there are no columns returned by the query called “Contact” or “Account”.

If we change the sort conditions to instead be “accountname” and “namelf” then sorting on these columns works.

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) news and product updates!

You have Successfully Subscribed!