locked
Intercepting associated view for list entity RRS feed

  • Question

  • Hi all,

     

    According to Geroge Doubinski's blog post (http://crm.georged.id.au/post/2008/03/07/Displaying-inactive-records-in-associated-view.aspx) in intercepting the RetrieveMultiple query for an associated view of a contact I want to do something similar for a 'list' entity.

     

    By default the associated view of a marketing list shows BOTH active and inactive records. This is unlike the contact associated view which has a built in filter to show only active records. I would like to override the associated view for the list entity to only show active records. Therefore I need to add a condition filter into the retrieve Multiple query.

     

    Obviously I will be using a plug-in but my question is how do I intercept the associated view and can I look for the "LocalizedName description =  Marketing List Associated View"?

     

    Thanks 

     

    Thursday, February 10, 2011 6:38 AM

Answers

  • Hi Stanley,

     

    Hmmm, this does look like a bug. Associated views out of the box are supposed to return only active entities. I would report it.

    But in the meantime, you can indeed do something in reverse to what I've done with associated view. If you're after a quick fix, there is an easier way. Though unsupported, it'll "revert" the behaviour to what it should have been from the start :-).

     

     

    • Export marketing list customisations
    • Extract XML file from zip 
    • Find the <savedquery> element with the following subelement:
            <LocalizedNames>
             <LocalizedName description="Marketing List Associated View" languagecode="1033" />
            </LocalizedNames>
      
      
    • Find the following subelement in this <savedquery>
             <columnset version="3.0">
              <column>listname</column>
              <column>createdfromcode</column>
              <column>lastusedon</column>
              <column>purpose</column>
              <column>listid</column>
              <descend>listname</descend>
             </columnset>
      
      
    • Add a filter so it looks like this:
             <columnset version="3.0">
              <column>listname</column>
              <column>createdfromcode</column>
              <column>lastusedon</column>
              <column>purpose</column>
              <column>listid</column>
              <descend>listname</descend>
              <filter type="and">
               <condition column="statecode" value="0" operator="eq" />
              </filter>
             </columnset>
      
      
    • Save XML file
    • Import this customisation file into CRM
    • Publish Marketing List
    Done!
    HTH
    --

     

     


     


    George Doubinski, MVP http://crm.georged.id.au
    • Marked as answer by Stanley_Lai Thursday, February 10, 2011 8:59 AM
    Thursday, February 10, 2011 8:38 AM
    Moderator

All replies

  • Using this sample http://www.bizforward.cws-international.com/2011/01/26/create-a-custom-filtered-lookup-view-in-runtime-crm-2011/, you can dynamically get any view.
    Cornel Croitoriu - Senior Software Developer - www.Biz-Forward.com
    Thursday, February 10, 2011 6:44 AM
  • Sorry Cornel, not what I was after. I was looking for an associated view in CRM 4.

    Cheers

    Thursday, February 10, 2011 8:26 AM
  • Hi Stanley,

     

    Hmmm, this does look like a bug. Associated views out of the box are supposed to return only active entities. I would report it.

    But in the meantime, you can indeed do something in reverse to what I've done with associated view. If you're after a quick fix, there is an easier way. Though unsupported, it'll "revert" the behaviour to what it should have been from the start :-).

     

     

    • Export marketing list customisations
    • Extract XML file from zip 
    • Find the <savedquery> element with the following subelement:
            <LocalizedNames>
             <LocalizedName description="Marketing List Associated View" languagecode="1033" />
            </LocalizedNames>
      
      
    • Find the following subelement in this <savedquery>
             <columnset version="3.0">
              <column>listname</column>
              <column>createdfromcode</column>
              <column>lastusedon</column>
              <column>purpose</column>
              <column>listid</column>
              <descend>listname</descend>
             </columnset>
      
      
    • Add a filter so it looks like this:
             <columnset version="3.0">
              <column>listname</column>
              <column>createdfromcode</column>
              <column>lastusedon</column>
              <column>purpose</column>
              <column>listid</column>
              <descend>listname</descend>
              <filter type="and">
               <condition column="statecode" value="0" operator="eq" />
              </filter>
             </columnset>
      
      
    • Save XML file
    • Import this customisation file into CRM
    • Publish Marketing List
    Done!
    HTH
    --

     

     


     


    George Doubinski, MVP http://crm.georged.id.au
    • Marked as answer by Stanley_Lai Thursday, February 10, 2011 8:59 AM
    Thursday, February 10, 2011 8:38 AM
    Moderator
  • Awesome that worked George thanks !

    I have tried to do this in the past (modifying associated views via the xml) but I was never successfull. Think I was trying to add a <fetchxml> element which the associated view does not allow (it is ALWAYS set to NULL).

    Thursday, February 10, 2011 8:59 AM