Thursday, December 3, 2009

How to Create "My views" for custom entities

The Account entity in CRM comes along with pre-defined views for My Active Accounts.

However, when you create a custom entity you will notice that by default only two views are created “Active” and “Inactive”. If you would like to add “My Active” and “My Inactive” views for custom entities, you would need to create them yourself by customizing the entity.

To create a “My Active” view in custom entity just follow the below steps:

Here we take an example of “Test” entity.

Step 1: Navigate to Settings --> Customization --> Customize Entities --> Select the entity and navigate to the Forms and Views Option


Step 2 : Enter the name of the View


Step 3 : Here you have to edit the filter criteria.


Set the following conditions
• owner Equals to Current user
• and status is equals to Active

as we are creating “My Active Test” view. You can give your Conditions according to the view


Once the criteria has been specified you can edit the columns to include the columns that you want displayed in this view.


Step 4: Save this view and publish the entity.
The My Active Test View will now be available similar to the “My Active Accounts” view.

Monday, November 30, 2009

Unable to connect to the remote server Error

“Unable to connect to the remote server Error”, this error occurs because the connection is lost with the server. When you make authenticated calls, the client opens the connection and then closes it as well. The connection is not re-used. If you make such calls repeatedly to the server, all available connections get exhausted. This can be fixed by modifying one of the TCP/IP parameters to increase the # of connections available. You would also need to insert a delay in your code using the Sleep statement to reduce the number of calls that are being made repeated to the server.

Solution:


1. Open registry editor.


2. Go to the following directory path to navigate to the registry key: “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters”

3. Look for the TcpTimedWaitDelay key name. If not found, add it by selecting Edit > New > DWORD Value from the menu bar. Rename the key name to “TcpTimedWaitDelay”. (see below the screen)


4. Double-click inside the right pane again to set the value of TcpTimedWaitDelay. Select Decimal as the Base, and enter 30 in the Value data field.(see same as below the screen)

5. Look the MaxUserPort key name. If not found, add it by selecting Edit > New > DWORD Value from the menu bar named “MaxUserPort”. Set its value to a decimal value between 5000 and 65534


6. You must restart Windows for these settings to take effect

Sunday, November 29, 2009

How to Track the Next Action and Last Touch dates on Account

Quite often you need to monitor and have workflows designed based on the "Last Touch Date" or the "Next Action" date. While the former should reflect the last interaction made with the customer, the later is to keep track of the next upcoming interaction with the customer.

End users often believe the Modified date reflected on the Account form, is the "Last Touch Date". Well, that is not true. The Modified date on the Account Form is only updated when any changes are made directly to any of the attributes on the account form. Even adding of a note to the account does not update the "Modified Date". To track the true "Last Touch date", you would require to write a custom plugin or perhaps a Workflow could do the job as well.

How to track "Last Touch Date" using Workflow.

You need to trap the create/update/status change events of all the activities that you need to track for an account. Assuming that we would set the regarding to Account for each activity that we create.

1. New Worklow - Set the entity as Appointment - Event Create, Update and Status change


2. Add step to Update entity as shown as below screenshot.

3. Choose Regarding(Account) as shown as below screenshot.


4. Select custom date attribute for tracking "Last touch" set date = Workflow execution as shown in the below screenshot.

How to track "Last Touch Date"/Next Action Date using Plugins.

You need to write Plugin to trap the create/update/chnage status events of the activities. In the Post event, read the account associated with the activity and update the "Last Touch Date" with today's date.

For the next action date, in each of these events, you need to read the account associated with the activity. Using the RollupActivitiesforAccount “TargetRollupActivityPointerByAccount” you can get the next due activity and update the "Next Action Date" to this date.

You receive an Sql Error when Importing Customizations

You may come across the following error when you try to import the customizations for an entity that already exists in the system.

This error is often a result of data type mismatch between the attributes in the new customization file being imported and the entity attributes already defined in CRM. Say for example an entity has an attirbute of the type picklist in CRM. However the same attribute is now defined to be of the data type int in the new customization file that needs to be imported. CRM allows for onyl unique attribute names. Now since it already has an attribute of the same name but a different data type it cannot overwrite that attribute with the new data type defined in the customization file.

To fix the problem, you need to delete the existing attribute from CRM entity. Publish the entity customizations. Now try to re-import the customization file. It will import without any SQL errors.

Wednesday, November 18, 2009

Tips on using Mail Merge Functionality in Dynamics CRM

Like most Contact Managers, Dynamics CRM too provides the Mail Merge ability. Recently we spent quite some time trying this out and we would like to share some of the findings that I am sure would assist other beginners in this area

1. Mail Merge functionality has been added as a privilege and so only users with the necessary privileges would be allowed to perform a mail merge. Mail merge is also available through the Web interface.

2. When the Mail merge process opens the Microsoft Word window to allow for designing of the Template make sure of the following

a. Enable Macros


b. Make sure the CRM addin is enabled and you have to click on this for the CRM mail merge to begin.
3. Though Mail merge can be used from Web interface as well, having Outlook client installed brings up some additional features like ability to “Upload” the mail merge template directly to CRM.



4. There are two ways to upload Mail Merge templates to CRM, one being design the template using the “Create Mailmerge template” button in MS word.

Save the Template file in Microsoft Word XML format.
Attach this document to CRM.
If you had the CRM Outlook client installed and Outlook running, the Word Mail merge wizard would display the “Upload Template” option.


Choosing this would automatically upload the document to CRM.

5. Mail Merge functionality is available for only selected System entities like
· Quote
· Lead
· Opportunity
· Account
but all custom entities are available for selection for Mail Merge

6. Only for the Quote entity would you find the “Related Products” entity in the data fields selection window.

No other one-to-many relations of any entity would be available for mail merge. However all lookup attributes would have their related entities available for selection in the data fields.

7. To design a mail merge template that lists out all the exported entries in a single document instead of creating one document per exported line of data choose the Mail Merge type to be “Directory”.


After you insert the mail merge fields and click on preview, it would still display each record on a separate page. To check the results as a list in a document, complete the merge and export the merge to another document to see the entire list in a single document.