locked
CRM 2015 Online, create view on second 1:N relationship RRS feed

  • Question

  • Hi,

    In our CRM 2015 Online, between Account and Opportunity, there are many 1:N relationships, because there are many Account lookups in Opportunity.  Say, the first 1:N is labeled as Opportunity 1 in left navigation panel in Account form, and the second 1:N is labeled as Opportunity 2 in left navigation panel in Account form.  Now, I need to create a custom system view to display Opportunity 2 in a subgrid in Account form.

    The problem is if I go to Settings -> Customizations -> Customize the System -> Opportunity -> Views, I can only be able to create a custom system view which is based on Opportunity 1. So, how do I create a view which is based on Opportunity 2, the second 1:N? Thanks.

    Further, can I create a view including both 1:N relationships?

    Wednesday, October 21, 2015 2:11 AM

Answers

  • I figured it out.  Creating view in Advanced Find or Customize the System will default to the first 1:N relationship.  However, you can associate any view with a different relationship.  The place where you can associate a view with another 1:N relationship is where you design and define the subgrid in form editor.

    In my case, after I inserted a subgrid in Account form, I went to define the Data Source.  For Records, I chose "Only Related Records".  For Entity, I chose another well-labeled 1:N relationship with Opportunity, i.e. Opportunity 2.  For Default View, I chose Open Opportunity.  Bam! it worked.

    • Marked as answer by chicago bq Wednesday, October 21, 2015 8:22 PM
    Wednesday, October 21, 2015 8:22 PM

All replies

  • Hi,

    Check if the relationship is visible on the related entity (or primary, I never learn which is which).

    For question 2, I can't think of any easy way of doing that on one view since the related-records-search-thingys in fetch are always an "and"-search, you could be able to do it in a custom-html-search where you create a view yourself.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Wednesday, October 21, 2015 10:58 AM
  • I agree with Rickard; sometimes the only way to get a particular list of records is to create an HTML web resource that uses an OData query and displays the results in a grid control.  I've even gone as far as standing up a caching service to handle really complex queries.
    Wednesday, October 21, 2015 12:09 PM
  • Thanks both,

    Creating an HTML web resource makes the grid read-only.  User will not be able to Add/Remove opportunity from the grid.  BTW, I can see both 1:N relationships in Account, and both N:1 relationships in Opportunity.

    From navigation menu of a particular account, I can see the list of Opportunity 1 and Opprunity 2 respectively via Opportunity Associated View.  So, I am wondering how Opportunity Associated View filters two 1:N relationship without any problem?  Can I create a custom Opportunity Associated View only to retrieve the second 1:N relationship?

    Wednesday, October 21, 2015 2:29 PM
  • I figured it out.  Creating view in Advanced Find or Customize the System will default to the first 1:N relationship.  However, you can associate any view with a different relationship.  The place where you can associate a view with another 1:N relationship is where you design and define the subgrid in form editor.

    In my case, after I inserted a subgrid in Account form, I went to define the Data Source.  For Records, I chose "Only Related Records".  For Entity, I chose another well-labeled 1:N relationship with Opportunity, i.e. Opportunity 2.  For Default View, I chose Open Opportunity.  Bam! it worked.

    • Marked as answer by chicago bq Wednesday, October 21, 2015 8:22 PM
    Wednesday, October 21, 2015 8:22 PM