A nice feature of the CRM LAN/Windows client is when you select a row in a grid and go to the entity, such as clicking on a contact in the account’s contacts grid to go to the contact, it will set the temp lookup group to the other contacts for the account you opened it from. Somewhere along the way this was implemented for the web client as well, however, it only works for some entities and not others. For example, if you go to an account and click one of the contacts for the account, you will go to the contact page and the lookup group will show the other contacts for that account, although this doesn’t work for clicking on a quote on the account’s quotes grid – you won’t get a temp lookup group for the other quotes for the account. Worse, for custom entities it doesn’t work at all. So, the functionality does exist. Let’s take a look at how to use it and make it work for custom entities.
First, here are some related articles for programmatically setting the Lookup Results group.
Programmatically Setting Custom Conditions for the Lookup Results Group in Infor CRM (Saleslogix) Web
Programatically Creating a Temporary Lookup Group for a specific entity in the SalesLogix web client
Note, the articles linked above show how to do this programmatically via code. What we want to do here is leverage the out of the box functionality and have this behavior work without any extra code at all. Let’s take a look.
After some digging, I found that this out of the box behavior comes from an XML file that defines a page for a table and then defines the “parent” relationship to use to set the lookup results context based on the table of the page the user came from. This XML file is located in the SupportFiles for the SlxClient portal and named “ContextualListConfiguration.xml“. Open this file and you can see how these are defined. For example, the section for the SalesOrder page is defined as follows:
<TargetConfigInfo> <TargetPage>SALESORDER</TargetPage> <ReferingPages> <ContextConditionInfo> <ReferringPage>ACCOUNT</ReferringPage> <DataPath>SALESORDER:ACCOUNTID</DataPath> <ConditionValue>ReferringId</ConditionValue> </ContextConditionInfo> <ContextConditionInfo> <ReferringPage>Default</ReferringPage> <DataPath>SALESORDER:SALESORDERID</DataPath> <ConditionValue>CurrentId</ConditionValue> </ContextConditionInfo> </ReferingPages> </TargetConfigInfo>
At runtime this XML file is read by GetContextConditionInfo method in Sage.SalesLogix.Client.GroupBuilder.dll and then sets a condition for the LookupGroup based on what is in that file. For the SalesOrder section above, it defines that for a page based on an entity whose table is SALESORDER, if the user came from a page based on an entity whose table is ACCOUNT, it will use the SALESORDER.ACCOUNTID to set the context for the group, meaning you’ll see all the sales orders for the account the user just came from.
NOTE: Everything in this XML file needs to be database table and field names. Not entity or property names and not page aliases. The TargetPage and ReferringPage values aren’t the “page”, but the table the page is based on (with the exception of the “Default” keyword). DataPath are all table & field names as well.
You can add your own sections to this as well for custom entities (or add the missing one for QUOTE). Then just deploy and it’s done. Keep in mind that for upgrades, you’ll lose changes to this unless you merge your custom file with any new one to preserve your changes (or add your custom sections back in after the upgrade).