locked
I think I found a bug with some lookup field settings (default view and filtering) RRS feed

  • Question

  • Hi there,

    I set a lookup field that uses a specific view that filter records based on a given criteria, and with the view selector turned off.

    However, if the user perform a search in the lookup window, but then click on the "X" next to the searchbox to return to the previous view, it seems like the view is "reset", and all records are being shown, despise the view with a filter criteria I have previously specified.

    As a workaround, I had to remove the searchbox.

    Any ideas?


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Thursday, April 19, 2012 4:37 PM

Answers

  • Hi pmdci,

    There seemed to be something not quite right from your screen shot. In the field property setup screen, its showing "Active Parent Industries" as the default view but in the Look Up Record form, it showing "Industry Lookup View". I did some testing on my system (UR7) but was not able to reproduce the symptoms you are describing. Perhaps change the Field attribute settings and re-publish.

    This is how my screens look.


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    • Marked as answer by pmdci Friday, April 20, 2012 10:45 AM
    Friday, April 20, 2012 9:56 AM
  • Hi Eric,

    You have a good point there and I have noticed this before.

    If I remove the search (Display search Box in lookup dialog = off) then the title in the lookup view for the view is correct: Active Parent Industries

    However if I leave the search box in the lookup view turned on, then the title in the lookup view changes to "Industry Lookup view". But here is what I noticed:

    • a) Even though it says "Industry Lookup view", the view behaves like the "Active Parent Industries" view. That is, until I perform a search and reset the view (which is the focus of the problem.
    • b) When the lookup form loads, for a glimpse of a second I can see the disabled dropdown for the view selection flashing, as if some sort of code or business logic is forcing the field back to "Industry Lookup view"

    So I just tried another workaround. I left the search box on, then I set the Default view as "Active Parent Industries", but then I left the view selector on, but only allowing the "Active Parent Industries" as an option (published the changes). And ta-dah... It worked.

    Then I tried one more time to set the view selector as OFF, and leave the Search Box on (published the changes). And ta-dah... It worked!

    This was a surreal experience (?!). I have no jScript or any other sort of customisation that affects the behaviour of the lookup dialog. All I have is a jScript on the onChange event of my Main Industry field that does the following:

    • reset the value of the Sub Industry field
    • If Main industry is NULL, also disable the Sub Industry field

    Well this is working now. Thanks for the help! But I am still convinced this is some sort of bug. The workaround is to perform changes on the View Selector and the Default view for the lookup field, publish, then try again, then publish.

    Thanks for the help!

    Cheers,
    P.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    • Marked as answer by pmdci Friday, April 20, 2012 10:45 AM
    Friday, April 20, 2012 10:45 AM

All replies

  • Hi,

    Are you talking about CRM 2011 out-of-the-box filtered lookup feature?

    If so, did you uncheck "Allow users to turn off filter" on your lookup field customization?


    Thursday, April 19, 2012 6:59 PM
  • Yes. It is CRM 2011 and I did all that :)

    I also changed the default view to a custom one, and I turned the view selector off.

    Even though, if I try to perform a search in the lookup dialog (any search, doesn't matter) and then I click on the X to reset the listing within the lookup dialog, the filtering of my view is disregarded.

    It is really a bug. The workaround is to hide the Search Box in the lookup dialog.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Thursday, April 19, 2012 7:32 PM
  • What's the rollup update of your CRM system?

    I've just tested on my CRM environment with UR5 and it's working fine.

    If yours is in latest rollup, pls provide the screenshot of the lookup field properties.

    Friday, April 20, 2012 2:07 AM
  • Hi Linn,

    I have UR6 here.

    Here are the settings for the lookup field properties:

    Lookup field properties

    The view I specified (Active Parent Industries) show records from the Industry entity that are active and have no parent specified. That is because an Industry without a parent is a "root" (top level) Industry. The Industry entity has a 1:N relationship with itself, allowing the nesting of categories and subcategories, and I have a second lookup field that only show records based on the selection of this lookup field.

    Here is what happens when I try this lookup field:

    Testing the lookup field

    At first the view is working correctly[1]. That is, it only show records with no parent industry specified. However, if I do a search [2], and then I click on the X mark to reset the view after the search [2], the view is then reset, showing all Industry records (including the ones that have a parent industry specified) [3].

    Looks like a bug to me. What do you reckon?


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Friday, April 20, 2012 8:20 AM
  • Wait, I just noticed that you're not using "Related Records Filtering"

    Are you creating a custom filtered lookup view in runtime with JavaScript by adding custom FetchXML as in the following way?

    http://crmdm.blogspot.com/2011/05/lookup-filtering-in-crm-2011-using.html

    I thought you was talking about "CRM 2011 out-of-the-box Related Record Filtering lookup feature"

    Friday, April 20, 2012 8:39 AM
  • Linn,

    No FetchXML.

    I am talking about the records being filtered in the view of the lookup dialog.

    I explained the issue in full detail in my previous post.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    Friday, April 20, 2012 8:44 AM
  • Hi pmdci,

    There seemed to be something not quite right from your screen shot. In the field property setup screen, its showing "Active Parent Industries" as the default view but in the Look Up Record form, it showing "Industry Lookup View". I did some testing on my system (UR7) but was not able to reproduce the symptoms you are describing. Perhaps change the Field attribute settings and re-publish.

    This is how my screens look.


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    • Marked as answer by pmdci Friday, April 20, 2012 10:45 AM
    Friday, April 20, 2012 9:56 AM
  • Hi Eric,

    You have a good point there and I have noticed this before.

    If I remove the search (Display search Box in lookup dialog = off) then the title in the lookup view for the view is correct: Active Parent Industries

    However if I leave the search box in the lookup view turned on, then the title in the lookup view changes to "Industry Lookup view". But here is what I noticed:

    • a) Even though it says "Industry Lookup view", the view behaves like the "Active Parent Industries" view. That is, until I perform a search and reset the view (which is the focus of the problem.
    • b) When the lookup form loads, for a glimpse of a second I can see the disabled dropdown for the view selection flashing, as if some sort of code or business logic is forcing the field back to "Industry Lookup view"

    So I just tried another workaround. I left the search box on, then I set the Default view as "Active Parent Industries", but then I left the view selector on, but only allowing the "Active Parent Industries" as an option (published the changes). And ta-dah... It worked.

    Then I tried one more time to set the view selector as OFF, and leave the Search Box on (published the changes). And ta-dah... It worked!

    This was a surreal experience (?!). I have no jScript or any other sort of customisation that affects the behaviour of the lookup dialog. All I have is a jScript on the onChange event of my Main Industry field that does the following:

    • reset the value of the Sub Industry field
    • If Main industry is NULL, also disable the Sub Industry field

    Well this is working now. Thanks for the help! But I am still convinced this is some sort of bug. The workaround is to perform changes on the View Selector and the Default view for the lookup field, publish, then try again, then publish.

    Thanks for the help!

    Cheers,
    P.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    • Marked as answer by pmdci Friday, April 20, 2012 10:45 AM
    Friday, April 20, 2012 10:45 AM
  • I tried to simulate your issue but it's working for me since from the the beginning.

    Seems like your case is sort of exceptional.

    Saturday, April 21, 2012 4:32 AM