Posts

Open Data Protocol

The open data protocol is a web protocol for querying and updating data.OData does this by applying and building upon web technologies such as HTTP Atom publishing Protocol (AtomPub) JSON to provide access to information from variety of applications,services and stores. OData being used to access information from different sources like Relational Data base File Systems Content management systems Traditional  web sites OData is consistent with the way the Web Works.This Commitment to core Web Principles allow Odata enable a new level of data integration and interoperability across the broad range of clients,server, services and tools. OData provides the uniform way to expose,structure,query and manipulate data using REST practices and JSON or ATOM.OData also provides a way to reprasent metadata about the data,allowing computers to know more about the type system,relationships and structure of the data.

REST Endpoint or OData operations in MS CRM 2011-Part 1

To locate and retrieve data with the REST Endpoint, manipulate URI. The organization root URL must include organization. We can retrieve service root URI by using Xrm.Page.context. getServerUrl Each MS CRM 2011 entity is represented in the conceptual schema definition language (CSDL). The Naming convention is [ Entity Schema name] Set MS CRM 2011 entity attributes. Each property is assigned a data type that corresponds to one of the primitive Entity Data Model (EDM) data types or Complex type defined for MS CRM. Complex Types: 1.        Microsoft.Crm.Sdk.Data.Services.EntityReference à represents EntityReference and Customer Owner. 2.        Microsoft.Crm.Sdk.Data.Services.OptionSetValue à OptionSetValue, State and Status. 3.        Microsoft.Crm.Sdk.Data.Services.Money à Money 4.        Microsoft.Crm.Sdk.Data.Services.BooleanManagedProperty à BooleanMangedProperty Entity Reference Name Type Id GUID Logical

Calling a WCF Service in MS CRM 2011

One of excited future of WCF service is execute a WCF service by custom code. This future is very helpful to call WCF Service in MS CRM 2011 plug-in. We can use BasicHttpBinding concept of WCF. Code :   BasicHttpBinding  binding =  new   BasicHttpBinding ();  binding .Name =  "BasicHttpBinding" ;  binding .Security.Mode =  BasicHttpSecurityMode .None;  binding .Security.Transport.ClientCredentialType =  HttpClientCredentialType .None;  binding .Security.Transport.ProxyCredentialType =  HttpProxyCredentialType .None;  binding .Security.Message.ClientCredentialType =                                                     BasicHttpMessageCredentialType .UserName;   EndpointAddress  endPointAddress =  new   EndpointAddress (“your WCF Service URL”); using  ( ServiceClient  holidayService =  new ServiceClient ( binding , endPointAddress )) { //Required Code }

Send email to custom entity record in MS CRM 2011

In older versions of MS CRM (4.0 & 30), we don’t have a provision to choose a custom entity record in TO list but in MS CRM 2011 have a provision to do that by simple customizations. Steps to achieve ·          Fill the required fields to create a custom entity. ·          Goto Communications & collaborations section o    Select the sending e-mail (if any email field does not exit, one will be created) check box. Above simple option selection custom entity became available TO field in email activity.

Calculation of Week Start Date and Week End Date on given day in SQL

Week Start Date: SELECT DATEADD(dd,1-Datepart(DW,getdate()),GETDATE()) Week End Date: SELECT DATEADD(dd,7-Datepart(DW,getdate()),GETDATE()) Month Start Date SELECT DATEADD(mm, -1,DATEADD(dd, +1, EOMONTH(GetUTCDATE()))) Month End Date SELECT EOMONTH(GetUTCDATE())

ASP.NET Web Application vs Web site Projects

Web Application : 1. All Code behind files and standalone class files are compiled into a single assembly. 2. Explicit namespaces are added to pages, controls, and classes by default. 3. The Visual Studio code analysis feature works. 4. Compiling in advance makes sure that users do not have to wait while the site compiles on the production server. Website : 1. Web site projects are compiled dynamically by ASP.NET. basically we have two compilation mode a. Batch compilation mode-> which produces the assembly for folder. b. Fixed compilation mode-> which produces the one assembly for each page or user control. 2. Explicit namespaces are not added to pages, controls, and classes by default, but you can add them manually. 3. Visual Studio code analysis feature does not work. 4. You can test specific pages regardless of the state of other pages. 5. It is easy to update a Web site in production.

Using Read-only versus const

There are Two difference versions of constants in C#: the Const keyword is used for compile –time constants read only keyword is used for runtime constants. The main issue with const is that it's evaluated at compile-time, which means if it's changed at a later date; you have to not only recompile that application, but all applications that reference that application. In contrast, read -only is evaluated at run-time providing you a lot more flexibility. An overview of differences between const and read-only in c#      Const Read only Cont be static Can be either instance-level or static Value is evaluated at compile time The value is evaluated at run time. It is initialized at declaration only It can be initialized in declaration or by code in the code constructor .therefore read only fields have difference values depending on constructor used.   So, const should really only be used for logical, real-world constants such as days of week, numeric Constants, etc. as for as perfo