Tuesday, 9 October 2012

converting Managed solution to Unmanaged solution Work around:

This is useful when we have only Managed solution to work with but needs some more customization. Extract the Solution Zip file, Open solution.xml file in notepad application. Search for Managed Tag (E.g.: <Managed>1</Managed>), Now change the value from 1 to 0 and zip the files again and import it. That’s it The Solution is changed to Unmanaged. This can be imported and customized as per the need.

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')?

•            />