Monday, 1 October 2012


 

CRM 2011 LINQ Operator Limitations:


.       from

–       Supports one from clause per query.

•          join

–       Represents an inner join. You cannot perform outer joins.

•          where

–      The left side of the clause must be an attribute name and the right side of the clause must be a value.

–      Supported String functions: Contains, StartsWith, EndsWith, and Equals.

•          groupBy

–      Not supported. FetchXML supports grouping options that are not available with the LINQ query provider.

–      For more information, see Use FetchXML Aggregation.

•          orderBy

–       Supports ordering by entity attributes, such as Contact.FullName.

•          select

–       Supports anonymous types, constructors, and initializers.

•          last

–       The last operator is not supported.

•          skip and take

–       Supports skip and take using server-side paging. The skip value must be greater than or equal to the take value.

•          aggregate

–       Not supported. FetchXML supports aggregation options that are not available with the LINQ query provider. For more information, see Use FetchXML Aggregation.

 

FetchXML syntax:


Legend:

•          Xxxx :=   à production

•          (   ) à choice

•          | à or

•          ? à optional

•          * à repeat

// à comments

 

FetchXml :=

  <fetch

    (page='page-number')? // start page default is 0

    (count='items-per-page')? // count default is 5000

    (utc-offset='utc-offset')? // utc-offset default is 0

    (mapping='logical')?

    (distinct = ('true' | 'false' | '1' | '0') )? //default false

    (paging-cookie='page-cookie')?

   >

    <entity name='entity-name'>

    Entity-Xml

    </entity>

  </fetch>

 

 Example:

<fetch page=‘10’ count=‘50’ distinct=‘true’

     page-cookie=‘Page1’>

    <entity name=‘account’ >

    …. Put Entity-Xml here ….

    </entity>

</fetch>

 

 

 

•          Entity-Xml :=

•          (<all-attributes/> | <no-attrs/> |Attribute-Xml* )

•            ( Filter-Xml |  LinkEntity-Xml |  Order-Xml )*

•          Attribute-Xml :=

•            <attribute name='attr-name'

•              (aggregate=(AggOp) alias='alias-name')?

•            />

•          AggOp :=

•          (avg | min | max | count(*) |count(attribute name))

•          Filter-Xml :=

•            <filter (type= ('or' | 'and'))? // default is 'and'  >

•            ( Condition-Xml | Filter-Xml )*

•            </filter>

•           

•          LinkEntity-Xml :=

•            <link-entity name = 'entity-name'

•              // to is the column on the remote entity

•              (to = 'column-name')? 

•              // from is the column on the local entity

•              (from = 'column-name')? 

•              (alias = 'table-alias')?

•              (link-type = ('natural' | 'inner' | 'outer'))?

•            >

•            Entity-Xml

•            </link-entity>

•          Order-Xml :=

•            <order attribute='attr-name'

•              (descending= ('true' | 'false' | '1' | '0')?

•            />

 

 

Friday, 28 September 2012

Some of the CRM Blogs:


Ronald Lemmen - http://ronaldlemmen.blogspot.com/
Philip Richardson - http://blog.philiprichardson.org/
Gonzalo Ruiz - http://gonzaloruizcrm.blogspot.com/
Ross Lotharius - http://www.avanadeblog.com/xrm/
CRM Team Blog - http://blogs.msdn.com/crm/default.aspx
Andy Bybee - http://bybeeworld.spaces.live.com/
Ben Riga - http://blogs.msdn.com/benriga/default.aspx
Ben Vollmer - http://blogs.msdn.com/midatlanticcrm/default.aspx
Menno te Koppele - http://blogs.msdn.com/mscrmfreak/
Simon Hutson - http://blogs.msdn.com/ukcrm/default.aspx
Aaron Elder - http://www.avanadeblog.com/xrm/
Frank Lee - http://microsoft-crm.spaces.live.com/
Guy Riddle - http://guyriddle.spaces.live.com/
Matt Witteman - http://icu-mscrm.blogspot.com/
Michael Höhne - http://www.stunnware.com
Mitch Milam - http://blogs.infinite-x.net/
Scott Colson - http://msmvps.com/blogs/crm/default.aspx

 

A good link , which explains clearly silver light webresource developmet in mscrm 2011 using rest end point:

 
 

Code snippet for custom wcf service calling from mscrm 2011 form java script:




Call the Custom WCF request in Java Script:

Var xmlhttp = new XMLHttpRequest ();

Retrieve the WCF URL from from “ApplicationConfig” Entity using following method.

Var WcfServiceUrlValue= GetConfigValueByKey (Key Name);

WcfServiceUrlValue=WcfServiceUrlValue.avd_ConfigValue;

xmlhttp.open('POST', WcfServiceUrlValue , false);

//Get the request XML from WCF Test Client or Using Feddler Tool

//Place the Inteface name and Method Name following highlighted text.

xmlhttp.setRequestHeader('SOAPAction', 'http://tempuri.org/IDynamicsPaymentService/UpdateExpiredCheque ');

xmlhttp.setRequestHeader('Content-Type', 'text/xml');

var data = '';

data+='<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">';

data+='<s:Body>';

   data+='UpdateExpiredCheque  xmlns="http://tempuri.org/">';

   data+='<data xmlns:d4p1="http://schemas.datacontract.org/2004/07/ UU.Crm.WCFService.DataContracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">';

       data+='<d4p1:CaseNumber>12345</d4p1:CaseNumber>';

        data+='<d4p1:ChequeAmount>200</d4p1:ChequeAmount>';

        data+='<d4p1:ChequeNumber>23421213</d4p1:ChequeNumber>';

        data+='<d4p1:OriginalPaymentDate>1/10/2012</d4p1:OriginalPaymentDate>';

        data+='<d4p1:OriginalPaymentReference>1234</d4p1:OriginalPaymentReference>';

      data+='</data>';

    data+='</UpdateExpiredCheque>';

  data+='</s:Body>';

  data += '</s:Envelope>';

            xmlhttp.send(data);

            xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

            xmlDoc.async = false;

            xmlDoc.loadXML(xmlhttp.responseXML.xml);

//Check the Response Object  and Retrieve the tag values following way.

if (xmlDoc.xml != "") {

                var Msg;

                var ResponseCollection = xmlDoc.getElementsByTagName("a:ResponseCollection");

                if (ResponseCollection.length > 0) {

                    if (ResponseCollection[0].firstChild != null) {

                        Msg = "Message Severity :" + ResponseCollection[0].firstChild.childNodes[0].nodeTypedValue + '\n';

                        Msg += "Warning :" + ResponseCollection[0].firstChild.childNodes[1].nodeTypedValue;

                        alert(Msg);

                    }

                }

            }