Filtered Sub-grid lookup RRS feed

  • Question

  • I'm trying to achieve the following setup for a client in CRM2015:

    They have a 2-level hierarchy of Accounts (Head-office and Branches) that are related using the 'Parent Account' field. For each Parent Account, there are multiple ways they internally group the related child accounts with the parent account.  To replicate this grouping, I've created a new entity called 'Account Lists' that allows them to select a parent account and then in a Sub-grid select one or more of the related child accounts.

    These are the steps I took so far:

    1) Added a new View to the Accounts Entity called 'Child Accounts' which displays all accounts where a custom option set value is equal to Child
    2) On the new 'Account Listings' Entity I created a N:N relationship with the Accounts entity
    3) Inserted a Sub-Grid on the form and selected the following for Data Source:
     -Records - Only selected records
     -Entity - Accounts (Child Accounts)
     -Default View - Child Accounts
    4) In additional options, I applied the following settings:
     -View Selector: Show Selected Views
     -In the Views list, I only have the 'Child Accounts' view selected

    The problem I'm having is that the Sub-grid drop down and related lookup is displaying all accounts, including parent accounts, and not just child accounts.  Is there something I've done wrong here or do I need to be looking at custom lookups with JavaScript to achieve what I'm looking for?

    Thank you

    • Edited by Cipher Sunday, March 29, 2015 7:11 PM
    Sunday, March 29, 2015 6:55 PM

All replies

  • Just wanted to add some more information in case I helps explain this issue:

    1) Our custom 'Account Lists' entity only contains two controls: a lookup and a subgrid.

    -The lookup is labeled Parent Account and only allows the user to select an Account where a custom option set field value is equal to "Parent".  The lookup view attached to this lookup is a custom view called Parent Account that enforces this restriction.

    -The second control is a subgrid labeled Child Accounts.  Similar to the lookup, we've tried to apply a custom View to filter which accounts the user can select.  In particular, we created a view called Child Accounts as we're hoping they would only be able to select Child Accounts from the subgrids related selectors (ie via the plus button or after clicking the "Lookup More records" link).

    2) The enforcing of the default View between the Lookup and Subgrid is behaving differently as follows:

    -When the user opens the lookup, they are presented with the "Parent Account" view and cannot select any other View.  This is perfect.

    -With the subgrid, when the user clicks the plus button (+) they are shown 10 accounts, but the accounts shown include both Parent and Child accounts and not just Child accounts as we expected when assigning our custom view to this grid.  Also, even though I see the name of the custom View (Child Accounts) to the left of the plus button, the grid is displaying different fields then those defined by the view.

    -Similarly, when they click the "Lookup More Records" link and are presented the Look up Records window, the default view is the native "Account Lookup View" and all the other Account views are available for selection.  I was expecting to see only our "Child Accounts" view to be available for selection so the users could only add these Accounts to the grid.

    Any idea why we can enforce a default view on the lookup, but not the subgrid?  Am I missing something here or is this is a bug in CRM 2015?

    Monday, March 30, 2015 6:10 PM