Showing posts from 2013

TimeoutException: The request channel timed out while waiting for a reply after 00:00:59.7350618. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

Hi, You need to set Timeout property of OrganizationServiceProxy class as below; OrganizationServiceProxy proxy = (OrganizationServiceProxy) ...; proxy.Timeout = new TimeSpan(0, 20, 0); //20 minutes good luck,

Microsoft Dynamics CRM Product Key Is Not Valid or Cannot Be Used with the Current Deployment in CRM 2011

Hi, i face invalid product key error when i add a new Front End node to the existing CRM 2011 deployment with Rollup14. I think,Rollup 6 and Rollup 14 has significant changes on the deployment. You can ignore "System Check" via Registry to continue installing process of the CRM 2011. To do :  Just add the DWORD key IgnoreChecks with a value of "1" to the MSCRM key in the registry [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM]. 

you get "visual studio .net must be installed before you can install the Microsoft Dynamics CRM Developer Toolkit"

if you are not able to install Developer Toolkit for Microsoft dynamics CRM 2011 and faced an error as "visual studio .net must be installed before you can install the Microsoft Dynamics CRM Developer Toolkit" Please try below, it works for me. Go and "run as administrator" the PowerShell (x86) Locate the folder that contains the .msi file (cd c:\.... etc) run the powershell command: MSIEXEC /i crmdevelopertools_installer.msi (/i argument stands for "install") cheers,

Log4net in windows service

Hi, Log4net not working in windows service although working same project as Windows Application. I just put [assembly: log4net.Config.XmlConfigurator(Watch = true)] into AssemblyInfo.cs and magically solved.

set Timeout ,Max Recieve Package size and no credential in WCF

1 - to increase Timeout in client; Open Web.config add parameter(s) into binding element as TimeSpan openTimeout= "12:00:00" receiveTimeout="12:00:00" closeTimeout="12:00:00" sendTimeout="12:00:00" 2 - to increase limiting Package Size in client; Open Web.config add below into Binding element as integer maxReceivedMessageSize="2147483647" 3 - to set non-security connection in service; Open Web.config add below into binding element as child element             good luck,

I am thinking...:)

                     Traditionally,systems such as databases and logic-programming systems have tended to support closed worlds and unique names, whereas knowledge representation systems and theorem provers support open worlds and non-unique names.

Retrieve User Settings such as Time Zone code or Localize Id in MSCRM 2011

Hi, You may need connected user settings or any user that you have ID. Please follow below;  var currentUserSettings = _serviceProxy.RetrieveMultiple(                 new QueryExpression(UserSettings.EntityLogicalName)                 {                     ColumnSet = new ColumnSet("localeid", "timezonecode"),                     Criteria = new FilterExpression                     {                         Conditions =                         {                             new ConditionExpression("systemuserid", ConditionOperator.Equal,UserID)                         }                     }                 }).Entities[0].ToEntity ();             //currentUserSettings.LocaleId;             currentUserSettings.TimeZoneCode.Value; //get TimeZoneCode good luck,

CRM Explorer/Tools missing from Visual Studio 2010

if you ever find the Dynamics CRM 2011 Explorer / Tools options missing from within Visual Studio 2010 .... ... check prerequisites are installed:- 1. Visual Studio 2010 SP1 2. Silverlight 4 3. Windows Identity Foundation 4. CRM Developer Tools (found within the CRM SDK, Tools folder) Then check that the following is mentioned in your solution file (if you open the .sln file in a text editor): Save and reload the solution in Visual Studio 2010.  Do not append 'SolutionIsBoundToCrm = True' line to the below if you meet in your solution file. GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection good luck,

Exception caught instantiating TERADATA report server extension SQL Reporting Services

Hi, If you face an error in Reporting Services Log File (C:\Program Files\Microsoft SQL Server\MSRSxx_xx.MSSQLSERVER\Reporting Services\LogFiles) such as : extensionfactory!ReportServer_0-1!ea4!03/26/2013-08:20:15:: e ERROR: Exception caught instantiating TERADATA report server extension:  System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.  ---> System.IO.FileNotFoundException: Could not load file or assembly 'Teradata.Client.Provider, Version=, Culture=neutral, PublicKeyToken=76b417ee2e04956c' or one of its dependencies. The system cannot find the file specified. File name: 'Teradata.Client.Provider, Version=, Culture=neutral, PublicKeyToken=76b417ee2e04956c'    at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)    at System.Refl

flip rows to column in SQL Server

Below is a table that i use in the example; AttendeeName GroupName QuestionName AnswerName QuestionId Value Result Order SurveyId AnswerId Ahmet Ege Kisisel Bilgiler Askerlik Yaptiniz mi? (Q1) Evet (A1) 1 1 5 1 11 4 Ahmet Ege Kisisel Bilgiler Evli misiniz? (Q2) Hayır (A2) 2 1 6 3 11 5 Ahmet Ege Kisisel Bilgiler Is ariyor musunuz? (Q3) Evet (A3) 3 1 1 2 11 7 and the result expectation is;

Get PickList value for Reports or other SQL statements

There is a table,'StringMap' which contains map of id with value. you can run any select statement against this table.'AttributeValue' takes key and 'value' takes value of the key.You should do some filter actions to focus on to the exact data that we may need so add 'ObjectTypeCode' as type code of Entity and 'AttributeName' as name of the field to the where statement. Example; SELECT AttributeValue,Value FROM StringMap WHERE ObjectTypeCode = '1' and AttributeName='customertypecode' Query will return CustomerTypeCode of Account. There is also alternate, if you do not know type code of the entity; FilteredViewName must be name of the entity with 'Filtered' prefix : Filtered+account. SELECT AttributeValue,Value FROM FilteredStringMap WHERE FilteredViewName= 'Filteredaccount' and AttributeName='customertypecode' query will return same result as above. good luck.

how to Filter lookup in CRM 2011 by javascript in Client Side.

You can set any lookup with custom view in client. Here is a simple javascript code build dfor CRM 2011.This code run in onLoad of  Response  Custom entity. relation of the entities EntA 1---N EntB 1---N EntC 1-- N EntD for the sample. Filter rule is; Lookup gets only selected EntAs for the EntD function onLoad() { //filter questions for the current EntC var EntCLookup = Xrm.Page.getAttribute("field of the EntityReference of EntC").getValue(); if (EntCLookup != null) { var EntCId = EntCLookup[0].id; var viewId = "{8F03FB3E-0EFF-4417-B704-80CE1711B8D2}";/static guid can obtain by Visual Studio tool var entityName = "EntA"; var viewDisplayName = "EntA Filtered View by EntC"; var fetchXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>" + "<entity name='EntA'>&q

how to serialize an object to XML, and vice versa

Hi, Here is code sample of Serializing and Deserializing.There is also some additional methods to convert Byte Array in the sample. i use serialize and deserialize actions by generic in C# private Byte[] StringToUTF8ByteArray(String pXmlString) { UTF8Encoding encoding = new UTF8Encoding(); //UTF8Encoding is under the System.Text namespace Byte[] byteArray = encoding.GetBytes(pXmlString); return byteArray; } private String UTF8ByteArrayToString(Byte[] characters) { UTF8Encoding encoding = new UTF8Encoding(); String constructedString = encoding.GetString(characters); return (constructedString); } private string Serialize(T request) { //MemoryStream is in System.IO //XMLSerializer is in System.Xml.Serialization using (MemoryStream memoryStream = new MemoryStream()) { XmlSerializer xs = new XmlSerializer(typeof(T)); XmlTextWriter

retrieve columns from LinkedEntities in Microsoft CRM 2011

Hi, You prepare QueryExpression and add some LinkedEntities then you want to retrieve fields from linked part.Just follow the sample;  QueryExpression query = new QueryExpression()                     {                                         ...                                         ...                     };                     FilterExpression filterTicket = new FilterExpression();                     ...                     query.Criteria = filterTicket;                     //all about ticket                     query.LinkEntities.Add(new LinkEntity("contact", "new_new_ticket_contact", "contactid", "contactid", JoinOperator.Inner));                     query.LinkEntities[0].EntityAlias = "contacttoticket"; add alias to reach the fields                     query.LinkEntities[0].Columns.AddColumn("new_ticketid"); add column names to the same level of LinkedEntity to obtain later...                

Complex Query in QueryExpression in Microsoft CRM 2011

Hi, Here is tables and relation,QueryExpression statement afterwards. contact 1--->N new_ticket N --> N new_tour QueryExpression query = new QueryExpression()                     {                         EntityName = "contact",                         ColumnSet = new ColumnSet(new string[] {                                                             "contactid",                                                             "firstname",                                                             "lastname",                                                             "birthdate",                                                             "fullname"                                                             }                                                   )                     }; Query Expression will execute the query against contact. For performance issue; do not retrieve any columns that we do

how to insert resource especially System User into Resource Group in Microsoft CRM 2011 SDK

Hi Again, First,we have to get deep technical information about Constraint definition file; here is the definition in XML format; <Constraints>   <Constraint>     <Expression>       <Body>         resource["Id"] == {ac8e6996-ef65-e211-bc9b-005056820011} ||         resource["Id"] == {4a65de5a-d763-e211-bc9b-005056820011} ||         resource["Id"] == {626E49EC-2011-E211-84B5-005056820011}       </Body>       <Parameters>         <Parameter name="resource"/>       </Parameters>     </Expression>   </Constraint> </Constraints> Body tag refers to any resources in the Resource Group. if you add primary key as guid for the record  to the constraint with 'or' logical word, you will see them in the selected resource group in CRM You can get inspiration from AddMembersToTheConstraint methods as shown bolew,Method takes  constraints string and id of mem

Create Resource Group in Microsoft CRM via SDK

Hi, if you create a resource in crm, use ConstraintBasedGroup class. here is a sample code ;     //get current Resource Group     List resourcegroupS = context.ConstraintBasedGroupSet.Where(rg => rg.Name == " ").ToList();     if (resourcegroupS.Count <= 0) //if exists     {                         //create resource group:                         resourcegroupDriver = new ConstraintBasedGroup                         {                             BusinessUnitId = new EntityReference(BusinessUnit.EntityLogicalName, businessunit.Id),                             Name = "Drivers : " + businessunit.Name,                             Constraints = builder.ToString(),                             GroupTypeCode = new OptionSetValue(ConstraintBasedGroupTypeCode.Static),                         };                         xxx.Id = _serviceProxy.Create(resourcegroupDriver);                     }     } if you need more information about 'context&

manage SQL express 2008 via SQL developer (oracle) tool

Hi, I downloaded SQL Server 2008 Express Edition from Microsoft Web Site.After installed SQL express, i figured out that i did not install tools such as Microsoft SQL Server Management Studio.I decided to connect via SQL Developer which comes from Oracle 11G client package instead MSSQL Management Studio. It is very easy.The first thing we have to be sure that Microsoft SQL Server JDBC Driver 3.0. exists in our system. ( )

search text in Stored Procedures

Do you want to find any text in Stored Procedures in SQL Server Database ? "select * from INFORMATION_SCHEMA.ROUTINES" returns Procedure,Function exist in specific database. You will see objects and details in columns.

create connections between two entities with Late Binding in Microsoft CRM 2011

Hi, I would like to share benefits of connections in Microsoft CRM 2011 and how to build connection in 2 Entities by LateBinding. Connected entities may be both Custom or System. here is how the SDK describes the benefits of Connections Connections  provide the following capabilities: An easy and flexible way to make a connection between two records of most Microsoft Dynamics CRM entity types. All customizable business and custom entities can be enabled for connections. An option to add useful information, such as description of the connection and the duration. An ability to create connection roles that describe the relationship between the two records, such as a relationship between a doctor and a patient, or a manager and an employee. A quick way to create multiple connections and roles for a particular record. For example, a contact may have many relationships with other contacts, accounts or contracts. In each relationship a contact may play a different role. Informa

make relationship in Microsoft CRM SDK

If you want to make 1 to N relation between two entities in CRM. You have couple ways.I would like to share two of them. First of all; You can make relation after creating new record .                         CustomEntityInCRM1 referrerEntity = ...//retrieve data;                         CustomEntityInCRM2 referencedEntity = ...//retrieve data;                         Relationship rs = new Relationship(" ");                         EntityCollection relatedEntities = new EntityCollection                         {                             EntityName = referencedEntity.LogicalName,                             Entities = {                                 referencedEntity                             }                         };                         referrerEntity.RelatedEntities.Add(rs, referencedEntity);                         _serviceProxy.Update(referrerEntity); or you can retrieve two of them and make connection (prevent 'The collection is re

Everything about Log4Net

log4net is a library to help the programmer output log statements to a variety of output targets by Apache Software Foundation (official page = can also download either source code or compiled library. It is compatible for .net project(s) and need to know couple basic things to use in your project easily. First of all, There is a configuration you have to set before adding into your project. Here is a sample about inserting log into a given file. app.config file;    <!--Start Code-->       <?xml version="1.0" encoding="utf-8" ?>          <configuration>             <configSections>                   <section name="log4net"                   type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>                </configSections>          <startup>             <supportedRuntime version="v4.0" sku=".NETFramework,