Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

How to Create Custom View using Fetch XML in MS CRM

$
0
0

Hello All,

My client using one third party solution if he imports the solution(Managed) in Dynamics CRM,one view(Account Lookup View) getting overridden with some filter criteria,

Please see the script below:

XML(1)

 <IntroducedVersion>5.0.0.0</IntroducedVersion>
            <LocalizedNames>
              <LocalizedName description="Account Lookup View" languagecode="1033" />
            </LocalizedNames>
          </savedquery>
          <savedquery>
            <isquickfindquery>0</isquickfindquery>
            <isprivate>0</isprivate>
            <isdefault>1</isdefault>
            <returnedtypecode>1</returnedtypecode>
            <savedqueryid>{00000000-0000-0000-00aa-000010001001}</savedqueryid>
            <queryapi></queryapi>
            <layoutxml>
              <grid name="resultset" object="1" jump="name" select="1" icon="1" preview="1">
                <row name="result" id="accountid">
                  <cell name="name" width="200" />
                  <cell name="telephone1" width="200" />
                </row>
              </grid>
            </layoutxml>
            <querytype>0</querytype>
            <fetchxml>
              <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
                <entity name="account">
                  <attribute name="name" />
                  <attribute name="telephone1" />
                  <order attribute="name" descending="false" />
                  <filter type="and">
                    <condition attribute="ownerid" operator="eq-userid" />
                    <condition attribute="statecode" operator="eq" value="0" />
                    <condition attribute="telephone1" operator="not-null" />
                  </filter>
                  <attribute name="accountid" />
                </entity>
              </fetch>
            </fetchxml>

Now  I modified the above xml Code and Added both(XML(1) && XML(2)) in the solution,but am not able to see the differences.

I wrote code as mentioned below:

XML(2)

<IntroducedVersion>5.0.0.0</IntroducedVersion>
            <LocalizedNames>
              <LocalizedName description="Custom Account Lookup View" languagecode="1033" />
            </LocalizedNames>
          </savedquery>
          <savedquery>
            <isquickfindquery>0</isquickfindquery>
            <isprivate>0</isprivate>
            <isdefault>1</isdefault>
            <returnedtypecode>1</returnedtypecode>
            <savedqueryid>{00000000-0000-0000-00aa-000010002001}</savedqueryid>
            <queryapi></queryapi>
            <layoutxml>
              <grid name="resultset" object="1" jump="name" select="1" icon="1" preview="1">
                <row name="result" id="accountid">
                  <cell name="name" width="200" />
                  <cell name="telephone1" width="200" />
                </row>
              </grid>
            </layoutxml>
            <querytype>0</querytype>
            <fetchxml>
              <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
                <entity name="account">
                  <attribute name="name" />
                  <attribute name="telephone1" />                
                  <filter type="and">
                    <condition attribute="statecode" operator="eq" value="0" />
                 </filter>                
                </entity>
              </fetch>
            </fetchxml>

Now My Requirement is:

When i import a custom solution

I need two Views as:

1.Account Lookup View---Default one--Shouldnt be overrriden

2.Custom Account Lookup View---same as XML(1).

Can any one help on this


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>