Tuesday 31 January 2012

Leaving Intergen

Crm 2011 UI Terminology. Application and Entity form screen regions

Application Screen Regions

Entity Form Screen Regions

Increase the Maximum Records exported to Excel

There are two ways to achieve it.

Method 1: Use Dynamic Excel spreadsheet
1) Select the view list you want to export. For example: Active Contacts.

2) Click Excel from the list toolbar and select Dynamic Worksheet option

3) Open the excel workbook and enable Data Connection if required

4) On the excel workbook, right click the data area, select Edit Query

5) If there is a pop-up windows about "The query cannot be edited by the Query Wizard", click ok. Now you will see the Microsoft Query window.

6) From the Microsoft Query toolbar, click View and select SQL. A new pop-up Windows showing the actual SQL statement appears.

7) Remove Top 10000 from the SQL statement and click OK to exit the SQL statement window

8) From the Microsoft Query window toolbar, click File and select Return Data to Microsoft Office Excel

9) Refresh your excel worksheet if auto-refresh is not enabled and you should see all data from the select CRM view now

Ref: http://usingmscrm.blogspot.co.nz/2009/09/export-to-excel-only-showing-10-000.html

Method 2: Change settings in CRM SQL Database
Follow the steps below to make the change at the database level in CRM 4.0. Maybe CRM 2011 as well.

Open SQL Mangement Studio
Use the _MSCRM database
Open the OrganizationBase table
Locate the column – MaxRecordsForExportToExcel
Change the value to the new value

Ref: http://www.powerobjects.com/blog/2010/03/29/increase-the-maximum-records-exported-to-excel/
http://support.microsoft.com/kb/911395

Credit to Elaiza Benitez

When you export plugin, you need to export plugin's steps too.

When you export plugin, you need to export plugin's steps too. The steps are called Sdk Message Processing Steps.

Plugin Deployment in CRM 2011 - Best Practices

http://crmdm.blogspot.co.nz/2011/03/plugin-deployment-in-crm-2011-best.html

Monday 30 January 2012

Microsoft Dynamics CRM: Workflow Authoring Best Practices

The Microsoft Dynamics CRM workflow engine provides powerful functionality for implementing custom business logic in a CRM deployment. However, it also lends itself to complex problems and design mistakes which can result in expensive maintenance and confused users. This article explains in detail a few important considerations when implementing workflows and custom workflow activities in CRM.

1. Composition with child workflows.

The workflow pattern is in general one of composition of smaller steps. Therefore, when creating a workflow, think about which parts of the workflow can be generalized as a "sub-process" and be reused in multiple workflow definitions. By isolating these smaller processes, one can define child workflows which can then be called from multiple workflow definitions. The advantage is that the child workflow can be easily modified as opposed to modifying multiple workflow definitions. It will also make it simpler to define future workflows that might be a composition of smaller processes or business logic. One important consideration is that child workflows are executed asynchronously with respect to the parent workflow. Therefore, you should not make use of child workflows for sub-processes which require sequential execution.

2. Awareness of persistence points in workflow definitions.

If you have a long workflow that might take a long time to execute you will need to consider whether the workflow will persist and what that implies. A workflow can be persisted because of multiple reasons: The workflow instance is waiting for some event to occur, the CrmAsyncService is stopped or the workflow instance explicitly requests to be persisted by executing an activity with the PersistOnCloseAttribute. In any case, the workflow engine unloads the workflow instance and persists it to the database until a user manually resumes the workflow or an event occurs which resumes the workflow automatically. The important considerations are

1) At what point does the workflow persist? The workflow will persist up to the step when the last activity is marked as a persistence point. Therefore, when it resumes, it will re-execute all the steps after the last persistence point. This is important if you have logic in your workflow which you want to guarantee does not execute more than once. Note that workflow instances are automatically persisted after the following CRM steps: create, update, send email, send email from template, assign, change status, child workflow and stage. For custom activities you can add [PersistOnClose] attribute to the activity class. (see http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.persistoncloseattribute.aspx).

2) When is the workflow going to resume? If the workflow will wait on an event that might never happen or take years to occur, then the database will soon contain thousands of waiting workflows which could affect performance. You should consider a design in which this situation is minimized. For example a workflow that waits on an opportunity to be marked as “won” can wait forever and the condition never meets. Instead wait on the opportunity to be closed and then check the status reason once it is marked as closed; if it was not marked as “won” you might want to add a Stop Workflow step at that point.

3. Write "atomic" custom activities.

Custom workflow activities should not implement the entire logic of the workflow, they are ideally small "atomic" steps that will make part of larger workflows. Because custom activities don't have the ability to control persistence, they should never cause the workflow to go idle or persist in the middle of a custom activity. Generally, it is better to have multiple custom activities that are called in sequence from a parent workflow than one large custom activity that implements all the logic in sequence. This also follows from the principle of workflow as a composition pattern. For example if your process is to take custom actions A, B and C when an account is opened, it is generally better to write a custom activity for each A, B and C separately and add a step for each activity in your workflow as opposed to writing a custom activity that implements A, B and C sequentially and then add a single step to the workflow to include this custom activity.

4. Correct use of "Execution Time".

The CRM workflow designer provides a property called "Execution Time" which can be used in dynamic expressions such as "if Account(CreatedOn) + 10 days < workflow(ExecutionTime)". The meaning of this property is neither the time at which the workflow is published nor the time the workflow instance starts. The actual value of this property is the real time when the workflow evaluates an expression that contains this property. Therefore, expressions such as "Wait until 1 day after workflow(ExecutionTime)" will never succeed and the workflow will wait and resume once a day forever causing performance problems. If you want your workflow to wait for a specific amount of time you should use the wait step and configure the condition as: workflow – timeout – equals – {Duation}. This will unload the workflow and resume execution after the specified time duration has passed. 5. Plugins Vs. Workflows. This is a common dilemma in CRM and there is no exact formula to find the best implementation method for a specific situation. However, this article provides some general rules of thumb that can be used to decide whether to use a plugin or a workflow: http://blogs.msdn.com/lezamax/archive/2008/04/02/plug-in-or-workflow.aspx Ref: http://blogs.msdn.com/b/crm/archive/2010/01/15/microsoft-dynamics-crm-workflow-authoring-best-practices.aspx

Correct use of "Execution Time"

The CRM workflow designer provides a property called "Execution Time" which can be used in dynamic expressions such as "if Account(CreatedOn) + 10 days < workflow(ExecutionTime)". The meaning of this property is neither the time at which the workflow is published nor the time the workflow instance starts. The actual value of this property is the real time when the workflow evaluates an expression that contains this property. Therefore, expressions such as "Wait until 1 day after workflow(ExecutionTime)" will never succeed and the workflow will wait and resume once a day forever causing performance problems. If you want your workflow to wait for a specific amount of time you should use the wait step and configure the condition as: workflow – timeout – equals – {Duation}. This will unload the workflow and resume execution after the specified time duration has passed.

Reference
http://blogs.msdn.com/b/crm/archive/2010/01/15/microsoft-dynamics-crm-workflow-authoring-best-practices.aspx

Sunday 29 January 2012

Create a Crm console app from scratch.

*Set the project's Target framework to be .Net Framework 4.

*To interact with Crm 2011 API, you can either refer to CRM 2011 sdk binary files or Service Reference
+ If you want to use sdk binary files: Include the
Microsoft.Crm.Sdk.Proxy.dll
Microsoft.Xrm.Sdk.dll in project reference
System.Security
System.Runtime.Serialization
and System.ServiceModel (This is for using WCF)

+ If you want to use Service Reference: Download the Organization Service endpoint from the Crm Developer Resources page.

*Reference the namespaces in the code.
using System.ServiceModel; // For using the WCF
using System.ServiceModel.Description; // You need this to use the ClientCredential class.
//Contains enumerations of possible picklists and integer values for some attributes.
//The naming convention of the classes is to make it easier to locate the specific attribute.
using Microsoft.Crm.Sdk;
//Defines the data contracts for attribute types, interfaces for authoring plug-ins,
//and other general purpose xRM types and methods.
using Microsoft.Xrm.Sdk;
//Defines classes for use by client-code, including a data context,
//proxy classes to ease the connection to Microsoft Dynamics CRM, and the LINQ provider.
using Microsoft.Xrm.Sdk.Client;
// Defines request/response classes for Create, Retrieve, Update, Delete, Associate , Disassociate, and the metadata classes.
using Microsoft.Xrm.Sdk.Messages;
// Defines query classes required to connect to Microsoft Dynamics CRM.
using Microsoft.Xrm.Sdk.Query;
Microsoft.Crm.Sdk.Messages;

The namespaces required for doing a WhoAmIRequest are Microsoft.Crm.Sdk, Microsoft.Xrm.Sdk.Client, Microsoft.Crm.Sdk.Messages, System.ServiceModel, System.ServiceModel.Description.

* Include the deviceidmanager.cs file in the project for authentication. Your can find the class in the crm sdk helper folder \\SDK CRM 2011\sdk\samplecode\cs\helpercode\deviceidmanager.cs.
+ Also include the Microsoft.Crm.Services.Utility namespace.

* Setup the credential which will be used to connect to Crm WCF endpoint

* Connect to WCF endpoint

* Require early bound type support

* Do something with theh endpoint


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel; // For using the WCF
using System.ServiceModel.Description;
// Contains enumerations of possible picklists and integer values for some attributes. 
// The naming convention of the classes is [open arrow brace]entityname[close arrow brace][open arrow brace]attributename[close arrow brace] to make it easier to locate the specific attribute.
using Microsoft.Crm.Sdk;
// Defines the data contracts for attribute types, interfaces for authoring plug-ins, 
// and other general purpose xRM types and methods.
//using Microsoft.Xrm.Sdk;
// Defines classes for use by client-code, including a data context, 
// proxy classes to ease the connection to Microsoft Dynamics CRM, and the LINQ provider.
using Microsoft.Xrm.Sdk.Client;
// Defines request/response classes for Create, Retrieve, Update, Delete, Associate , Disassociate, and the metadata classes.
//using Microsoft.Xrm.Sdk.Messages;
// Defines query classes required to connect to Microsoft Dynamics CRM.
//using Microsoft.Xrm.Sdk.Query;
using Microsoft.Crm.Services.Utility;
using Microsoft.Crm.Sdk.Messages;


namespace CrmConsoleApplication1
{
    class Program
    {
        private static OrganizationServiceProxy _serviceProxy;
        private static ClientCredentials _clientCreds;
        //private static ClientCredentials _deviceCreds;

        static void Main(string[] args)
        {
            // Setup credential
            _clientCreds = new ClientCredentials();
            _clientCreds.Windows.ClientCredential.UserName = "Administrator";
            _clientCreds.Windows.ClientCredential.Password = "NotTheRealPassword";
            _clientCreds.Windows.ClientCredential.Domain = "PLAYGROUND";
            // The DeviceIdManager class registers a computing device with Windows Live ID, through the generation of a device ID and password, 
            // and optionally stores that information in an encrypted format on the local disk for later reuse.
            // This will fail here as this vm don't have access to the Internet therefore there is no way for it to generate a device ID with login.live.com
            //_deviceCreds = DeviceIdManager.LoadOrRegisterDevice();

            // Connect to Crm WCF endpoint
            using (_serviceProxy = new OrganizationServiceProxy(new Uri("http://localhost:5555/CRM2011RTM/XRMServices/2011/Organization.svc"),
                                                                null,
                                                                _clientCreds,
                                                                null))
            {
                // require early bound type support
                _serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());

                OrganizationServiceContext orgContext = new OrganizationServiceContext(_serviceProxy);
                WhoAmIRequest request = new WhoAmIRequest();
                WhoAmIResponse response = (WhoAmIResponse)orgContext.Execute(request);
                Console.WriteLine("Your Crm user Guid is {0}", response.UserId);
            }

            Console.Read();
        }
    }
}

Saturday 28 January 2012

CRM 2011: IntelliSense for Xrm.Page

http://www.patrickverbeeten.com/pages/ContentItemPage.aspx?id=31&item=118&p=true

In CRM 2011 Javascript is no longer embedded in forms but now has build in feature to use external resource files. You can edit these files using the web browser or in an external editor. Visual studio supports Intellisense for JavaScript, this explains how enable the support for the CRM provided objects such as the Xrm.Page object to be shown.
To enable this support Visual Studio needs a reference to base the IntelliSense. First you need to download the reference file XrmPage-vsdoc.js (right click and choose save). Save this file on a convinient location. Now you can create a new js file in Visual Studio then add the following line to the top of this file:
///
The path to the file can either be relative or absolute, in this example the reference file is placed in a folder named IntelliSense in the folder where the new web resource js file is saved.

I have only tried this file with Visual Studio 2010. If there are any function which are incorrect or other errors please let me know.
This file is distributed as Freeware for details see here or the license contained in the file.

On this site http://crm2011snippets.codeplex.com you can download a set of snippets to automate common functions for JavaScript used with CRM.

Thursday 26 January 2012

ClickDimensions - Marketing addon for Crm.

I attended a ClickDimensions webinar today. They had a quite interesting product focus on marketing. Some highlights, you can use their product to create marketing email, web/portal forms, portal surveys. Their product can also track on who viewed your links in the email you sent and on your portal pages. The tracking is impressive and a bit scary. Their email template is definitely a step up from the out of box email template. Have a look at the links below.

However I think they are still lacking of features for facebook, twitter and other social tools.


Recorded and weekly webinars
http://www.clickdimensions.com/webinar/

How to Guides
http://www.clickdimensions.com/support/guides.asp

Wednesday 25 January 2012

Restaurants

Crazy horse
Red Hill

How to change crm 2011 online session timeout?

(On the ADFS server?)Open a Windows PowerShell window with Administrative Rights.
PS > Add-PSSnapin Microsoft.Adfs.PowerShell
PS > Get-ADFSRelyingPartyTrust -Name:”relying_party“
PS > Set-ADFSRelyingPartyTrust -TargetName “your_relying_party_name” -TokenLifetime 7200
So this code set the session timeout as 12 Hours (7200 minutes )
Don’t forget to replace your_relying_party_name with the real name in your AD FS 2 Manager –>Relying Party Trusts

http://www.interactivewebs.com/blog/index.php/server-tips/your-session-in-microsoft-dynamics-crm-is-about-to-expire-crm-2011-extend-session-time/

http://www.isvlabs.com/2011/11/how-to-set-dynamics-crm-2011-ifd-session-timeout/

Tuesday 24 January 2012

CRM Plugin Registration Tool restrictions and limitations

* Import solutions will not work for steps. You will get a plugin not found error. Even when the "Ignore Id's in Import Xml" option is ticked. Import solution will ONLY work for images.

Why set up UAT as a different organization is a bad idea

* Can not test rollups
* Can not test and turn tracing on if you got an execution error on UAT

Friday 20 January 2012

It is possible to debug a database deployed plug-in.

It is possible to debug a database deployed plug-in. The compiled plug-in assembly’s .pdb file must be copied to the server’s \Server\bin\assembly folder and IIS must then be restarted. After debugging has been completed, you must remove the .pdb file and reset IIS to prevent the w3wp.exe process from consuming additional memory.

Unit Testing Principles

General Principles

Test anything that might break.
Test everything that does break.
New code is guilty until proven innocent.
Write at least as much test code as production code.
Run local tests with each compile.
Run all tests before check-in to the repository.
Questions to Ask

If the code ran correctly, how would I know?
How am I going to test this?
What else can go wrong?
Could this same kind of problem happen anywhere else?
What to Test: Use Your “Right BICEP”

Are the results right?
Are all the boundary conditions CORRECT?
Can you check inverse relationships?
Can you cross-check results using other means?
Can you force error conditions to happen?
Are performance characteristics within bounds?
Good tests are “A TRIP”

Automatic
Thorough
Repeatable
Independent
Professional
CORRECT Boundary Conditions

Conformance: Does the value conform to an expected format?
Ordering: Is the set of values ordered or unordered as appropriate?
Range: Is the value within reasonable minimum and maximum values?
Reference: Does the code reference anything external that isn’t under direct control of the code itself?
Existence: Does the value exist (for example, is non-null, non-zero, present in a set, and so on)?
Cardinality: Are there exactly enough values?
Time (absolute and relative): Is everything happening in order? At the right time? In time?

Wednesday 18 January 2012

Business card scanner for CRM

Business card scanner for CRM

- Cardiris Corporate 5 for Ms Dynamics (Software only)
- IRISCard Anywhere for Ms Dynamics (Scanner + software)

How to use Crm 2011 OData interface

http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc

http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet(guid'44b4727c-6419-e111-b506-00155d321b47')

http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet(guid'44b4727c-6419-e111-b506-00155d321b47')/FirstName

http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet(guid'44b4727c-6419-e111-b506-00155d321b47')/FirstName/$value
Result: Brain

// Related records
http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet(guid'44b4727c-6419-e111-b506-00155d321b47')/Contact_Emails

$orderby [asc | decs]

Paging
$skip
$top

Filtering
$filter

http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet?$orderby=FullName desc

http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet?$top=2&$skip=3

http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet?$filter=FullName eq 'Susan Burk (Sample)'

//Get detialed info from related entity
http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet?$expand=account_primary_contact

//ONly show some fields
http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/ContactSet?$select=FullName, AnnualIncome

//What entities are avaiable
//Options will not be available
http://dev1/KelvinPlayground/XRMServices/2011/OrganizationData.svc/$metadata

Some basic syntax



Another interesting thing: Microsoft data market where you can publish you crm data here via odata.

Use the Microsoft Dynamics CRM 4.0 (2007) Endpoint in Crm 2011

Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online provide a backward compatible endpoint that lets you continue to use code that was developed for Microsoft Dynamics CRM 4.0.

http:///MSCrmServices/2007/CrmService.asmx

Ref:
http://msdn.microsoft.com/en-us/library/gg334316.aspx

Connect to Crm 2011 WCF interface via code

Library needed

The project will need to use .Net4 profile.

Using needed

Get Service method
var creds = new ClientCredentials(); //Get your current login

Tuesday 17 January 2012

Crm 4 workflow update children records from a parent record

Reference: http://www.dynamicscrmtrickbag.com/2009/09/02/account-contact-update/

Synchronize Child and Parent Records – with Workflows
Sherry Hale, a long-time Trick Bag reader, recently emailed me the following question:

…can you make a workflow that when an account address is updated, the contacts that share that address are also updated? It seems simple, but I can’t seem to pull in contact entity information on an account related workflow, nor can I start a contact child workflow from an account workflow.

Unfortunately, I had to answer her that she was correct: it’s not as simple as it seems it would be! An automatic workflow written against the Account entity doesn’t know anything about child records (like contacts, as in this example). In this sense, workflows are similar to Dynamics CRM Advanced Find: child records know lots about parent records, but parents don’t know anything about children.

You certainly can do that with code, and as soon as I find a good example of that kind of code out there I’ll post an update with a link to it. [If you know of any good examples of that or have written code to that effect yourself, please let me know and I'll give you ample credit!]

Updating Child Records from a Parent … with an On Demand Workflow
But, notice I said above that you can’t do it with an automatic workflow on the parent entity (in this case, account, but this is a more general point and will work the same way for anywhere in CRM where you’ve got a 1:N relationship). If you can live with an “on demand” workflow written for the child entity, it’s actually quite straightforward.

Here’s how you do it:

Create a new workflow for Contact, call it something descriptive like “Update Contact from Parent Account”.
Uncheck the default “Record is created” checkbox in the “Options for Automatic…” section, and make it available to run on demand:


Pull down the Add Step menu and give it a single Update Record action, on Contact, as I show in the above figure, then click Set Properties, and use Dynamic Values in the Form Assistant to update the fields on the child record(remember, the workflow will be run against any selected contacts, in this example!) with any values you want from the parent record (you can see the “Parent Customer (Account)” entity selected in the “Related Entities” list below, and also reflected in the values I’m using to update the fields on the contact record:


Save and Close, publish, and you’re ready to go.

If the workflow is published as an On Demand workflow for Contact, you’ll see it on any contact grid, including the so-called “Contact Associated View” for accounts. In an example like the following figure shows, I’ve clicked the Run Workflow button on the toolbar (which you won’t see unless you’ve got one of the on demand workflows published for Contact), and I’m about ready to change 119 contact records with updated address information from their parent account record.

So, Sherry, it might not be automatic…but it’s a lot better than doing them one at a time.

One More Thing…
You might be thinking: big deal: I can do that with a bulk edit. (select all the contact records you want and select Edit from the More Actions menu, and any updates you make to the fields there will be applied to all selected records). While it’s true that sometimes this will work, there are two limitations (at least) to the bulk edit approach that will still work in the workflow approach:

Plenty of fields can’t be edited with a bulk edit (e.g., certain lookup fields, such as Parent Customer). Any field can be updated with the workflow approach I showed here.
Another advantage of the workflow update approach is that you can apply logic in a workflow. For example, suppose you only want to update certain of those child records with the parent record values, and other ones you didn’t. If there are criteria determining which ones get the update and which ones don’t, you can put that into a “Check Condition” in a workflow, whereas “bulk edit” really is a bulk edit, and gets applied to every record no matter what.
I wrote a book on Dynamics CRM workflows, by the way, and it contains tons of examples like this one and other useful workflows. You can purchase the book on Lulu.com or on Amazon, and if you do, you can also get a (free) subscription to the online version of the book, where you can download the workflows themselves, customizations, and related content.

Here’s a link you can visit to find out more about my book and purchase it:

Monday 16 January 2012

Generate code with crmsvcutil #crmsvcutil extension #OrganizationServiceContext #OrganizationServiceContext

Syntax
CrmSvcUtil.exe /url:http:////XRMServices/2011/Organization.svc
/out:.cs /username: /password: /domain:
/namespace: /serviceContextName:

An example for generating early bound entities with a service context
CrmSvcUtil.exe ^
/url:http://localhost:5555/Crm2011RTM/XRMServices/2011/Organization.svc ^
/out:Xrm.cs ^
/language:CS ^
/domain:playground ^
/username:user-defined-usrname ^
/password:user-defined-pwd ^
/namespace:Xrm ^
/servicecontextname:XrmServiceContext

::The following para will only work if you run this bat file in the sdk\bin folder due to required dlls.
::/codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"

pause

An example for generating optionsets
CrmSvcUtil.exe ^
/codewriterfilter:"Microsoft.Crm.Sdk.Samples.FilteringService, GeneratePicklistEnums" ^
/codecustomization:"Microsoft.Crm.Sdk.Samples.CodeCustomizationService, GeneratePicklistEnums" ^
/namingservice:"Microsoft.Crm.Sdk.Samples.NamingService, GeneratePicklistEnums" ^
/url:http://servername/orgname/XRMServices/2011/Organization.svc ^
/out:OptionSets.cs

pause

* Copied from Crm 2011 sdk

To use the generated code you need using the following assemblies.
//For the on-premises or Internet-Facing Deployment (IFD) versions of Microsoft Dynamics CRM, //browse to the SDK\Bin\ folder.
Microsoft.Crm.Sdk.Proxy.dll

//For Microsoft Dynamics CRM for Outlook Online, browse to the SDK\Bin\Online\ folder.
Microsoft.Xrm.Sdk.dll

CodeGeneration extension VS no extension
Developer Extensions for Microsoft Dynamics CRM 2011 provides an extension to the CrmSvcUtil.exe command-line tool, called the Microsoft.Xrm.Client.CodeGeneration extension, which you can use to generate the data context and data transfer object classes for your Microsoft Dynamics CRM organization.

So what is the difference between use the extension or not?

As you can see from the screen dump below. When the codeCustomization extension is used, event related code is NOT generated therefore less code is generated. So use Microsoft.Xrm.Client.CodeGeneration to generate early bound crm entities are favorable. Just remember to run the bat file in the sdk\bin folder otherwise you may get error due to missing libraries.

Saturday 14 January 2012

How does the Manapouri power station works?

How does the Manapouri power station works?

http://patandpaulharvey.blogspot.com/2011/02/paradise-is-doubtful-sound-we-need-tag.html

iTune alternative. 3 Best Free Alternatives to iCopyBot.

iCopyBot
SharePod
CopyTrans Manager
iDump

http://www.3alternatives.com/free-alternatives-icopybot

How to use iPod as a USB disk.

Thursday 12 January 2012

KeyType:CrmWRPCTokenKey, Expired:True. The key specified to compute a hash value is expired, only active keys are valid.

Ever accessed Microsoft Dynamics CRM and got the error “The key specified to compute a hash value is expired, only active keys are valid.” The error logged in the trace is as follows:

MSCRM Error Report:
--------------------------------------------------------------------------------------------------------
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.

Error Number: 0x8004A106

Error Message: The key specified to compute a hash value is expired, only active keys are valid. Expired Key : CrmKey(Id:d0879dd3-7f9d-de11-a5c4-0003ff392bd3, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:09/09/2009 20:32:01, ExpiresOn:10/12/2009 20:31:55, CreatedOn:09/09/2009 20:32:01, CreatedBy:NT AUTHORITY\NETWORK SERVICE.

Error Details: The key specified to compute a hash value is expired, only active keys are valid. Expired Key : CrmKey(Id:d0879dd3-7f9d-de11-a5c4-0003ff392bd3, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:09/09/2009 20:32:01, ExpiresOn:10/12/2009 20:31:55, CreatedOn:09/09/2009 20:32:01, CreatedBy:NT AUTHORITY\NETWORK SERVICE.

Source File: Not available

Line Number: Not available

Request URL: http://localhost/Contoso/loader.aspx

Stack Trace Info: [CrmException: The key specified to compute a hash value is expired, only active keys are valid. Expired Key : CrmKey(Id:d0879dd3-7f9d-de11-a5c4-0003ff392bd3, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:09/09/2009 20:32:01, ExpiresOn:10/12/2009 20:31:55, CreatedOn:09/09/2009 20:32:01, CreatedBy:NT AUTHORITY\NETWORK SERVICE.]
at Microsoft.Crm.CrmKeyService.ComputeHash(CrmKey key, Guid scaleGroupId, HashParameterBase[] parameters)
at Microsoft.Crm.CrmKeyService.ComputeHash(CrmKey key, HashParameterBase[] parameters)
at Microsoft.Crm.Application.Security.WRPCContext..ctor()
at Microsoft.Crm.Application.Controls.AppPage.ValidateWrpcContext()
at Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.contoso_loader_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Simply restart the asynchronous service and reset IIS. This should make it work!!!

NAV AX

Both NAV and AX are ERP systems.
NAV is for small and medium companies
AX is for large companies and it is good at dealing with products

Wednesday 11 January 2012

What needs to be done to Crm 4.0 Client when users' AD password changed.

What needs to be done to Crm 4.0 Client when users' AD password changed.

User configuration to allow Microsoft Dynamics CRM e-mail router access to mailbox
I. Open the Microsoft Dynamics CRM Web client.
II. Click Tools from the menu, and then click Options.
III. Click the E-mail tab.
IV. Mark Allow E-mail Router to use my credentials to send and receive e-mail on my
behalf.
V. Enter the domain and username in the User name open text box.
VI. Enter the domain password in the Password open text box.
VII. Click OK.

Note: If Microsoft CRM user’s passwords are set to expire periodically in Active Directory, you
must complete these steps every time the password changes.

Tuesday 10 January 2012

NZ IT companies, company

NV Interactive
Green Button

Dump the Entity Metadata Crm 2011

This sample shows how to use the MetadataService Web Service. It creates an XML file that provides a snapshot of attributes for a single entity using the Metadata APIs. You can then open this file with Microsoft Office Excel.

This sample code can be found in the following files in the SDK download:

Server\HowTo\CS\Metadata\HowToMetadata.cs
Server\HowTo\VB\Metadata\HowToMetadata.vb

Event Execution Pipeline, Message Processing Stages

Crm 2011
Event Execution Pipeline
IpluginExecutionContext.StageStage values are int. You can use optionsets help class file from 2011 sdk to do so more easily.

Crm 4
MessageProcessingStage
Compare with Crm2011 which has 5 stages.

Crm 4 Crm 2011 programming difference, Syntax difference

Type Mapping Between Versions CRM 2011 and CRM 4

http://osmosee.wordpress.com/2011/06/15/crm-2011-plugin-syntax-changes/

http://roman20007.wordpress.com/2010/09/13/5-syntax-changes-in-dynamics-crm-2011-plugins/

Type mapping between versions Crm 2011 and Crm 4

SDK changes I’ve noticed while porting this from CRM 4.0 to CRM 2011

• Enumeration classes like Microsoft.Crm.Sdk.MessageName, ParameterName are not available
• IPluginExecutionContext.Depth is equal to 2 when the plugin is executed in the Update message
• CrmMoney is now Money, was expecting decimal since most other CRM data types are native .net types
• To get all the columns use new ColumnSet(true) instead of new AllColumns()
Input/OutputParameters of IPluginExecutionContext is now typeof ParameterCollection instead of PropertyBag

Javascript difference:
http://community.dynamics.com/product/crm/crmtechnical/b/crminogic/archive/2011/02/19/difference-between-crm-4-0-and-crm2011-script-for-using-on-form-customization.aspx

Testing CRM 4 Plug-ins

Testing CRM Plug-ins

Also think about plugin tester vs NUnit.

Changing the custom entity prefix in Microsoft Dynamics CRM 2011

The prefix that will be used when new attributes are created can be changed by updating the default publisher. This can be done by following the steps below:

1. Navigate to Settings > Customizations > Publishers.
2. Select the default publisher from the list.
3. Modify the prefix, changing it from new to the desired custom prefix, and click Save and Close.
4. Publish customizations by going to Settings > Solutions, and clicking Publish All Customizations.

Additionally, if you would like to create some fields with the new_ prefix, and some fields with the custom prefix, you can create a custom solutions that utilizes the new prefix. You can also utilize multiple different custom prefixes by creating separate solutions that utilize these prefixes.

http://support.microsoft.com/kb/2500602