Showing posts with label Fetch XML. Show all posts
Showing posts with label Fetch XML. Show all posts

Monday, February 3, 2014

Create View in CRM using coding.

 var fetchxml = "<fetch distinct='true' mapping='logical' output-format='xml-platform' version='1.0'><entity name='account'><attribute name='name'/><attribute name='primarycontactid'/><attribute name='telephone1'/><attribute name='accountid'/><order descending='false' attribute='name'/><link-entity name='incident' alias='ac' link-type='outer' to='accountid' from='customerid'/><filter type='and'><condition attribute='customerid' operator='null' entityname='incident'/><condition attribute='statecode' operator='eq' value='0'/></filter></entity></fetch>";

            var savedQuery = new SavedQuery()
            {
                Name = "Acount with no Cases",
                ReturnedTypeCode = "account",
                FetchXml = fetchxml,

                QueryType = 0
            };
            _service.Create(savedQuery);

Monday, July 1, 2013

How to get FetchXml of Advance Find View?

    var advFind = _mainWindow.$find("advFind"),
    iOldMode = advFind.get_fetchMode();
    advFind.set_fetchMode(Mscrm.FetchModes.ignoreEmpty);
    var sFetchXml = advFind.get_fetchXml();

Thursday, May 16, 2013

How to use Multivalued Parameter in Fetch XML based report in CRM 2011 online.


 you can use like this.
<filter type="and">
        <condition attribute="ownerid" operator="in" value="@UserName"/>
  </filter>

or using like


<filter type="and">
        <condition attribute="fullname" operator="like" value="@fname"/>
 </filter>