Tuesday, December 28, 2010

CRM 4.0 Recycle Bin

CRM 4.0 doesn't support the undelete / restore function, once you delete the record, it marks it as deleted and delete it physically in the next sweep.

CRM supports Activate/ De-activate to cover this but I faced a requirements regarding this, having a recycle bin in CRM 4.0 for the deleted and still in the DB records,



so said why not, let's have it.



please find the first trial on code plex soon it is under this link: http://crmrecycle.codeplex.com/

Tuesday, December 21, 2010

CRM 2011 Launch


I have installed CRM 2011 beta and liked it very much with the new enhancements and features.

dying to see it realeased in January 20th, 2011



enjoy ;)

Sunday, November 7, 2010

Microsoft Outlook is not set as the default mail client?


Today I install CRM Outlook on my Vista(with Outlook 2007), it gives me a strange error:"Microsoft Outlook is not set as the default mail client. Please set Microsoft Outlook as the default mail client from Control Panel\Internet Options\Programs, and then re-run the check."

I'm sure the Outlook is my default mail client, just in case I reset it again. but the error still exist! I'm aware of CRM always query Registry to get information in such cases, so open the default application key: HKLM\SOFTWARE\Clients\Mail, the Default value is Windows Live Mail, so change it to Microsoft Outlook, the error gone!

Thanks Jim
 

Saturday, June 19, 2010

Starting a Workflow from an Event Receiver - SharePoint 2007

Out of the Box there are only a few options to start a (custom) workflow. E.g. when an item is created or changed. This means that there are a lot of situations that a workflow is fired where it is not needed (often a workflow only needs to be started if a field has a specific value). Therefore we can write an event receiver to time better when a workflow is started. Below you find the code to start a workflow from your event receiver.

[code:c#]

public override void ItemUpdated(SPItemEventProperties properties)

{

if(YourCondition)

{

SPList parentList = properties.ListItem.ParentList;

SPWorkflowAssociation associationTemplate =

parentList.WorkflowAssociations.GetAssociationByName("Workflow Name",

new CultureInfo

(Convert.ToInt32(parentList.ParentWeb.RegionalSettings.LocaleId)));

SPSite siteCollection = properties.ListItem.ParentList.ParentWeb.Site;

siteCollection.WorkflowManager.StartWorkflow(properties.ListItem,

associationTemplate, String.Empty);

}

}

[/code]

Tuesday, June 15, 2010

CRM 4.0 Network Resource Image Control

As the name suggest this is an on-premise / VPN solution so consider if you need this to work across the web / IFD. The idea is to utilize a simple network share together with VB 6.0 Common Control Open Dialog which can be summoned using JavaScript. The nice thing about the Dialog is that it enables you to see files as thumbnails, set the initial directory and return the selected image path into a text attribute. That’s pretty much what you need to make this work.





You can add an ISV toolbar button to pop the dialog but I find that this solution works hand in glove with the text image button post I wrote a while ago.
Here is what is did in a nut shell:
Create a Add a new text attribute. I used the pager attribute on the contact form for the sake of this example.
Add a new Fixed Field 1:1 section to the contact form. This is done so the IFRAME
that displays the image will occupy half the screen.


Then add a the image IFRAME and pointed it to a default blank.jpg image.


Arrange the form attributes as you like … here is what I did.



Set the path attribute to read-only so selection is possible only when using the dialog.
Add the following code to the contact on load event box.

And Finally create a network share anywhere on the server and set appropriate user permission.



That’s it … pretty simple ah … feel free to comment.





Show no. of open or closed activities (history) on the CRM form.

Hello all,
Have you ever wanted to see the total no. of outstanding/completed activities on a Case, Account, Opportunity, Contact etc..? 

Well now you can, simply add the following JavaScript code to the onLoad event of the entity, it will query the webservice and it will give you the exact count of open/closed activities.
Update: 9th March 2010 - I have updated the code below and tested.
// this code is to get the number of activities and historical activities.
var buXml = GetRegardingActivity();
if(buXml != null)
{
    var buNodes = buXml.selectNodes("//BusinessEntity/q1:statecode"); // CRM 4.0
    var iActivity = 0;
    var iHistory = 0;

    if(buNodes != null )
    {
        /*get values*/
        for( i = 0; i < buNodes.length; i++)
        {
            switch(buNodes[i].text)
            {
                case "Open" : iActivity++; break;
                case "Scheduled" : iActivity++; break;
                case "Completed" : iHistory++; break;
                case "Canceled" : iHistory++; break;
            }
        }

        if(document.getElementById('navActivities') != null)
        {
            document.getElementById('navActivities').getElementsByTagName('NOBR')[0].innerText = document.getElementById('navActivities').getElementsByTagName('NOBR')[0].innerText + " (" + iActivity + ")";
        }

        if(document.getElementById('navActivityHistory') != null)
        {
            document.getElementById('navActivityHistory').getElementsByTagName('NOBR')[0].innerText = document.getElementById('navActivityHistory').getElementsByTagName('NOBR')[0].innerText + " (" + iHistory + ")";
        }
    }
}

function GetRegardingActivity()
{
    var xml = "" +
    "<?xml version="1.0" encoding="utf-8"?>" +
    "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">" +
    GenerateAuthenticationHeader()  +
    " <soap:Body>" +
    "<RetrieveMultiple xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+
    "<query xmlns:q1='http://schemas.microsoft.com/crm/2006/Query'"+
    " xsi:type='q1:QueryExpression'>"+
    " <q1:EntityName>activitypointer</q1:EntityName>" +
    " <q1:ColumnSet xsi:type="q1:ColumnSet">" +
    " <q1:Attributes>" +
    " <q1:Attribute>statecode</q1:Attribute>" +
    " </q1:Attributes>" +
    " </q1:ColumnSet>" +
    " <q1:Distinct>false</q1:Distinct>" +
    " <q1:Criteria>" +
    " <q1:FilterOperator>And</q1:FilterOperator>" +
    " <q1:Conditions>" +
    " <q1:Condition>" +
    " <q1:AttributeName>regardingobjectid</q1:AttributeName>" +
    " <q1:Operator>Equal</q1:Operator>" +
    " <q1:Values>" +
    " <q1:Value xsi:type="xsd:string">" + crmForm.ObjectId + "</q1:Value>" +
    " </q1:Values>" +
    " </q1:Condition>" +
    " </q1:Conditions>" +
    " </q1:Criteria>" +
    " </query>" +
    "</RetrieveMultiple>"+
    " </soap:Body>" +
    "</soap:Envelope>" +
    "";

    var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
    xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xmlHttpRequest.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
    xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
    xmlHttpRequest.send(xml);

    var resultXml = xmlHttpRequest.responseXML;
    return resultXml;
}
 
 
 
Source: http://mscrmblog.net/2009/05/18/show-no-of-open-closed-activities-history-on-the-crm-form/ 

Tuesday, June 8, 2010

SharePoint 2010 Licensing

SharePoint Foundation Server 2010  is the free offering replacing WSS 3.0. and will have the usual limits of SQL Express and Search Express.
The Standard  SharePoint functions will be base around Collaboration, Enterprise Search, Document and Content Management, Social Computing (Wikis, My Sites), Digital Asset Management (including Silverlight) and Records Management. Basically unstructured data.
The Enterprise  functionality is a long list:
  • Excel Services
  • Performance Point Services
  • Advanced Charting
  • Visio Services
  • Access Services
  • InfoPath Form Services
  • Client line of business integration and web parts
  • Custom Reports
In addition server licences can be upgraded to use FAST search.
Speaking of server licenses these break into Standard and Enterprise as before but this time there are both intranet and internet versions. Added to this is the aforementioned FAST server license which comes in both flavours too. So when you add this to the Foundation Server you have a total of seven types of SharePoint (a title for a post if ever I scribbled one).
Note that the SharePoint for Internet 2010 Standard Edition is designed for small to medium concerns and will retail at about half the price of the current MOSS for internet. But, and its a big but, it will be artificially throttled possibly round content size (the Microsoft boys were a bit hazy on this).
For intranet solutions the Client Access Model remains with the need to buy both a Standard  and Enterprise CAL  to access Enterprise features. For FAST although the license upgrade is for the server users utilising it will need an  Enterprise CAL.
Still with me?
Ok – SharePoint 2010 Online for intranet will continue with the current User Subscription License based on Enterprise, Standard and Deskless (read and form filling only). It will also have an Internet and Partner Access versions. Partner Access is effectively an extranet option.
For related technology:
SharePoint Workspace (the app formerly known as Groove) comes with Office 2010 PRO+ (which sounds like a caffeine tablet)
Office Web AppsOffice 2010 but do need SharePoint Foundation 2010  to work.
Project Server 2010 – needs a Project CAL  and a SharePoint Enterprise CAL
SQL Server Power Pivot  - SQL Enterprise Edition  if exposed only in office then an Office 2010 to be surfaced in SharePoint an Enterprise CAL  is required. 
Just for completeness there is also a non SharePoint version of FAST - Fast Search Server 2010 for Internet Business.


http://blogs.charteris.com/blogs/colinn/archive/2009/10/21/sharepoint-2010-licensing.aspx

Tuesday, March 23, 2010

Add Language Localization to InfoPath 2007 Form

When a form is used in several different countries the need for easy language localization becomes a very necessary goal. By leveraging expression boxes, a secondary data source, and data filtering techniques the ability to easily switch between languages on a form becomes a small feat.

Figure 1. An example of an InfoPath Form with localized text.
Although changing labels in a form is not difficult, there are will be some aspects missing from the form that keep it from achieving true localization. The following are some areas where you might run into problems when internationalizing your form:
  • Tooltip text
  • Insert Item links for repeating tables and sections
  • Button labels
  • Calendars from different parts of the world

In this task we will create a new blank form with a connection to a secondary data source that provides language localization settings. Let’s start by creating the XML file that will store the language settings.
Create the secondary data source:
Copy the following code into a text editor, and then save the file as Language Settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<LocalSettings>
    <Languages>
        <Language Name="English" Code="ENG"/>
        <Language Name="Español" Code="SPA"/>
        <Language Name="Français" Code="FRE"/>   
    </Languages>
    <Labels>
        <Label Name="First Name">
            <LocalLabel Code="ENG" Value="First Name"/>
            <LocalLabel Code="SPA" Value="Nombre"/>
            <LocalLabel Code="FRE" Value="Nom"/>   
        </Label>
        <Label Name="Last Name">
            <LocalLabel Code="ENG" Value="Last Name"/>
            <LocalLabel Code="SPA" Value="Apellido"/>
            <LocalLabel Code="FRE" Value="Nom de Famille"/>   
        </Label>
        <Label Name="Phone Number">
            <LocalLabel Code="ENG" Value="Phone Number"/>
            <LocalLabel Code="SPA" Value="Número de Teléfono"/>
            <LocalLabel Code="FRE" Value="Numéro de Téléphone"/>   
        </Label>
        <Label Name="Address">
            <LocalLabel Code="ENG" Value="Address"/>
            <LocalLabel Code="SPA" Value="Dirección"/>
            <LocalLabel Code="FRE" Value="Adresse"/>       
        </Label>
        <Label Name="Age">
            <LocalLabel Code="ENG" Value="Age"/>
            <LocalLabel Code="SPA" Value="Edad"/>
            <LocalLabel Code="FRE" Value="Age"/>
        </Label>
        <Label Name="FavoriteColor">
            <LocalLabel Code="ENG" Value="Favorite Color"/>
            <LocalLabel Code="SPA" Value="Color Favorito"/>
            <LocalLabel Code="FRE" Value="Couleur Préférée"/>
        </Label>
    </Labels>
    <Colors>       
        <LocalColor ID="Blue" Code="ENG" Value="Blue"/>
        <LocalColor ID="Blue" Code="SPA" Value="Azul"/>
        <LocalColor ID="Blue" Code="FRE" Value="Bleu"/>       
        <LocalColor ID="Green" Code="ENG" Value="Green"/>
        <LocalColor ID="Green" Code="SPA" Value="Verde"/>
        <LocalColor ID="Green" Code="FRE" Value="Vert"/>       
        <LocalColor ID="Red" Code="ENG" Value="Red"/>
        <LocalColor ID="Red" Code="SPA" Value="Rojo"/>
        <LocalColor ID="Red" Code="FRE" Value="Rouge"/>       
        <LocalColor ID="Yellow" Code="ENG" Value="Yellow"/>
        <LocalColor ID="Yellow" Code="SPA" Value="Amarillo"/>
        <LocalColor ID="Yellow" Code="FRE" Value="Jaune"/>       
    </Colors>
</LocalSettings>
Now that we have our secondary data source, let’s design our form.
Add the secondary data source:
  1. Design a new blank form.
  2. Choose Data Connections from the Tools menu, and then click Add.
  3. In the Data Connection Wizard, select Receive Data, and then click Next.
  4. Select XML Document, and then click Next.
  5. Click Browse, locate and select the Language Settings.xml file, click Open, and then click Next.
  6. Click Finish, click Yes, and then click Close.
Add the language selection drop-down list:
  1. Open the Controls task pane.
  2. Add a drop-down list box to the view.
  3. Double-click the new drop-down list, rename the field to LanguageChoice, and then select Look Up Values From A Data Connection in the List Box Entries section.
  4. Select Language Settings from the Data Connection drop-down list.
  5. Select /LocalSettings/Languages/Language for the Entries field by clicking on the icon to the right of the field.
  6. Select @Code for the Value and @Name for the Display Name. Refer to Figure 2.
  7. Click OK to close the Drop-Down List Box Properties dialog box.

Figure 2. Configuring the language selection drop-down list.
Add the layout table and controls:
  1. Open the Layout task pane.
  2. Insert a Custom Table with 3 columns and 4 rows.
  3. Merge the last two columns of the third and fourth row (refer to Figure 5).
  4. Open the Controls task pane, and then insert a text box control into the first column of the second row.
  5. Double-click this text box, change the name to FirstName, and then click OK.
  6. Insert a text box into the second column of the second row, and then change the name to LastName.
  7. Insert a text box into the last column of the second row, and then change the name to Age.
  8. Insert a text box into the first column of the last row, and then change the name to PhoneNumber.
  9. Insert a text box into the last column of the last row, and then change the name to Address.
Now that all of the controls are in the layout, we need to add labels so that the user knows what information to type into each field. Using expression boxes we can dynamically set the content of each label depending on the language preference.

LOCALIZED FIELD LABELS

Add the expression boxes with data filtering:
  1. Click inside the first column of the first row to set the insertion point.
  2. Select Expression Box from the Controls task pane.
  3. Click the Function button on the dialog box that appears.
  4. Click Insert Field or Group in the Insert Formula dialog box.
  5. Select Language Settings (Secondary) from the Data Source drop-down box, select /LocalSettings/Lables/Label/LocalLabel/Value, and then click Filter Data.
  6. Click Add.
  7. Select Name from the Select A Field or Group first drop-down list, select Labels/Label/Name, click OK, and then type First Name into the third drop-down list.
  8. Click And, select Code from the first drop-down list, and then select Select A Field Or Group from the third-drop down list.
  9. Select Main from the Data Source drop-down list, and then select myFields/LanguageChoice.
  10. Click OK 6 times.
  11. Repeat steps 1 through 9 for each additional label, except in step 7 type the text that corresponds to whichever label you are adding.

Figure 3. Specifying the filter conditions.

Figure 4. The completed function for the expression box.
Make the labels bold:
  1. Select all of the expression boxes by holding the Ctrl key while clicking each one.
  2. Click the Bold button (or type Ctrl+B).

Figure 5. The completed view.
Now our form has labels that change depending on what the user selects from the drop-down list. Let’s preview our accomplishments before adding a finishing touch.
Preview the form:
  1. Click Preview Form (or type Alt+P).
  2. Select any of the languages from the drop-down list.
  3. Notice how the labels are blank originally and then change to the specified language depending on what is chosen from the drop-down list.

Figure 6. Selecting the language.

Figure 7. Labels in Spanish.
To remedy the problem of all of the labels being blank by default we will add a default value to the myFields/LanguageChoice node.
Set the default language:
  1. Open the Data Source task pane.
  2. Double-click the myFields/LanguageChoice node.
  3. Type ENG as the Default Value, and then click OK.
With another quick preview you will see that the drop-down list is automatically set to English and none of the labels are blank.

LOCALIZED DROP-DOWN LISTS

Now that the expression boxes have all been updated to display appropriate labels depending on the language choice, we will add a drop-down list that demonstrates similar functionality. The secondary data source already has elements with all of the correct information, so we will simply add a drop-down list with the appropriate data filtering.
Add the drop-down list:
  1. Click below the table to set the insertion point and type Enter a few times to insert some white space.
  2. Add an expression box that displays the Favorite Color label using the process described in the first section.
  3. Open the Controls task pane and select Drop-Down List to insert a new control.
  4. Double-click the drop-down list, and then change the name to FavoriteColor.
  5. Select Look Up Values In A Data Connection, select Language Settings from the data source drop-down list, and then click the field selection button.
  6. Select Colors/LocalColor, and then click the Filter Data button.
  7. Click Add, select Code from the first drop-down list, and then select Select A Field Or Group from the third drop-down list.
  8. Choose Main from the data source drop-down list, select /myfields/LanguageChoice, and then click OK four times to return to the Drop-Down List Box Properties dialog box.
  9. Select the @ID attribute as the Value for the entries, select the @Value attribute as the Display Name, and then click OK.

LOCALIZED BUTTONS

The last aspect of adding localization to the form will be making sure that the button labels are correctly displayed. Unfortunately, InfoPath does not allow the button labels to be changed programmatically, so we are forced to use several button controls with conditional formatting to solve this problem. This same process can be used to change the tooltip text and Insert Item links for repeating tables and sections, but depending on how many languages need to be supported this can generate tremendous amounts of clutter in design mode.
Add the buttons:
  1. Open the Controls task pane and insert a button onto the view.
  2. Double-click the button, change the Label to Submit, change the ID to butSubmit.
  3. Click the Display tab, click the Conditional Formatting button, and then click Add.
  4. In the first drop-down list select LanguageChoice, select Is Not Equal To in the second drop-down list, and then select Type Text and type ENG into the third drop-down list.
  5. Select Hide This Control, and then click OK three times.
  6. Copy and paste the button until there are three identical buttons right next to each other.
  7. Change the Label on the second button to Sométase, change the ID to butSubmit, and then follow step 4 to apply conditional formatting using SPA as the text instead of ENG.
  8. Change the Label on the third button to Soumettre, change the ID to butSubmit, and then follow step 4 to apply conditional formatting using FRE as the text instead of ENG.
Note: The ID of all three buttons should be the same because they will all perform the same action and any code that you attach to one button should be attached to the others.

Figure 8. The completed form in design mode.



Source: http://www.infopathdev.com/blogs/matt/archive/2006/02/02/Add-Language-Localization-to-a-Form.aspx

Filtering Lookups in CRM 4

Lets get straight to the solution. Suppose you want to filter the Primary Contact lookup on the Account entity to show only contacts that belong to the data in the Parent Account field. 

Below is a simple JavaScript code to achieve that.

  • On the forms OnLoad event write the following code.
/* Form.onLoad() */
FilterLookup = function(source, target)
{
if (IsNull(source) || IsNull(target)) { return; }
var name = IsNull(source.DataValue) ? '' : source.DataValue[0].name;
target.additionalparams = 'search=' + name;
}

  • On the OnChange event of the Parent Account lookup mention the below code.
/* onChange() */
FilterLookup(crmForm.all.parentaccountid, crmForm.all.primarycontactid);

Note : Before you can see the code working, check the Parent Customer checkbox in the Contact Lookup View. Steps ->
  • Settings > Customization > Customize Entites > Contact > Forms & Views > Contacts Lookup View
  • Click on Add Find Columns on the right
  • Tick Parent Customer
  • Click OK and Publish
After performing the above mentioned, I select "A Bike Store" as the Parent Account and click on the Primary Contact Lookup.


The Contact lookup opens(as shown in the figure below) and you can see "A Bike Store" in the search box & CRM is only returned those Contact records whose Parent Customer is "A Bike Store."



Saturday, March 6, 2010

Microsoft Dynamics CRM “V.Next” [5]


The investments for the next release of Microsoft Dynamics CRM fall into three broad categories:

Deliver a new level of user productivity and collaboration capabilities

Continued enrichment of the core CRM capabilities

Provide a best-of-breed business solution platform

Development and testing is in progress for Microsoft Dynamics CRM “V.Next” which encompasses several milestone builds before various external feedback and testing programs are initiated with customers and partners in the lead-up to general release. There is an exhaustive list of investments in Microsoft Dynamics CRM “V.Next” which ranges from small “tweaks” and enhancements to broad new feature areas. The following sections provide a summary of some of the investments across the three categories.
“V.Next” to deliver a new level of user productivity and collaboration capabilities
Customers, partners and the analyst community continue to agree that the primary reason why a CRM solution may fail is simply that the users within an organization don’t use the software! A key product strategy for Microsoft Dynamics CRM “V.Next” is to continue to provide a CRM solution that users want to work with, is as familiar as their regular desktop software such as Microsoft Office and allows them to more effectively manage their day-to-day commitments and customer interactions regardless of their role. Building on the success of Dynamics CRM 4.0, Microsoft is committed to further investing in a rich and satisfying user experience leveraging both Microsoft Office and Windows.
Continue to improve the end-user experience: focus on providing further flexibility for a user to set up their role-based view of the system quickly. With each new release of Dynamics CRM Microsoft has reshaped how CRM functionality can be delivered through Microsoft Office Outlook to drive a more natural user experience. Microsoft Dynamics CRM “V.Next” will further enhance the user experience and information view of CRM data within Microsoft Office Outlook to ensure simplicity and ease of use.
Increase accessibility through the Microsoft Office “ribbon” interface: provide a user experience that is consistent with established Microsoft Office designs such as the ribbon interface. This style of interface is designed to increase efficiency and make it easier for users to find features to get their work done. 

https://mbs.microsoft.com/partnersource/marketing/statementofdirection/MD_CRM_SOD.htm

Wednesday, March 3, 2010

How to Configure Microsoft Dynamics CRM 4.0 E-mail Router (On-Premise) with Microsoft Exchange Server 2010

Update Rollup 8 for Microsoft Dynamics CRM E-mail Router (On-Premise) includes support for Microsoft Exchange Server 2010. In continuation to the blog titled “Configure Microsoft Dynamics CRM Online E-mail Router with Exchange Online”, this one explains the detailed steps required to setup Microsoft Dynamics CRM 4.0 E-mail Router (On-Premise) with Microsoft Dynamics CRM 4.0 On-Premise users and queues having mailboxes in Microsoft Exchange Server 2010.
Microsoft Exchange Server 2010 replaces the WebDAV functionality with Exchange Web Services (EWS). Microsoft Dynamics CRM 4.0 E-mail Router (On-Premise) with Update Rollup 8 has been enhanced to integrate EWS support and hence function with Microsoft Exchange Server 2010. The E-mail Router maintains compatibility with Exchange 2003 (only WebDAV) and Exchange 2007 (both WebDAV and EWS).
Prerequisites
  • Microsoft Dynamics CRM 4.0 On-Premise installation.
  • Microsoft Exchange Server 2010.
  • Microsoft Dynamics CRM 4.0 E-mail Router (On-Premise) with Update Rollup 8 or higher.
Configuration Steps
Microsoft Exchange Server 2010
Granting Exchange Impersonation permissions.
Microsoft Exchange Server 2010 makes do with the permissions model used in Microsoft Exchange Server 2007 and adopts the new Role Based Access Control (RBAC) allowing users to define extremely broad or extremely precise permissions models based on the roles of administrators and users. New commands are available to allow User/Mailbox Impersonation with varying scopes. Exchange Impersonation permission is required for a given Exchange 2010 account if it needs to cater to multiple Exchange 2010 accounts. The profile created with a user account having Exchange Impersonation permission can access the mailboxes of the users who are in the scope of this Exchange Impersonation permission.
In the Microsoft Exchange Server 2010 system, launch Exchange Management Shell from Start-> All Programs-> Microsoft Exchange Server 2010 -> Exchange Management Shell. The shell will connect to the Microsoft Exchange Server 2010 and display the prompt.
[PS] C:\Windows\System32>.
clip_image001
Example: impersonation scenarios
1. A single user is configured to connect to mailboxes of all other CRM users and queues that have their mailboxes on Microsoft Exchange Server 2010. This configuration hence makes do with the need to create profile for each CRM user and queue individually.
To achieve this you need to run the following command in Exchange Management Shell–
New-ManagementRoleAssignment   –Name: "ImpersonationName
-User: "RouterAdministrator@YourOrganization.com"   –Role:"ApplicationImpersonation”
In the above command, the Name parameter specifies a name for the new management role assignment. User is the username of the user who is given Exchange Impersonation permission and therefore can now access Exchange 2010 mailboxes of all other users in the Exchange organization.
[Details on New-ManagementRoleAssignment can be found here]
2. A single user is configured to connect to mailboxes of select set of CRM users and queues that have their mailboxes on Microsoft Exchange Server 2010. This configuration is preferable as the impersonation rights are given selectively on the desired mailboxes only.
To enable this scenario, you need to define the set of users as a Management Scope in Microsoft Exchange Server 2010. To do so, run the following command in Exchange Management Shell–
New-ManagementScope   –Name: "ManagementScopeName
–RecipientRestrictionFilter { Name  -eq  ‘ crmuser1 ’ }
In the above command, The Name parameter specifies the name of the management scope. The RecipientRestrictionFilter parameter specifies the filter to apply to recipient objects.
[Details on New-ManagementScope can be found here]
The new Management Scope created can now be used in the Role Assignment command to restrict the scope of Exchange Impersonation.
New-ManagementRoleAssignment   –Name: "ImpersonationName
-User: "RouterAdministrator@YourOrganization.com"   –Role:"ApplicationImpersonation”
-CustomRecipientWriteScope: ”ManagementScopeName
Removing Exchange Impersonation permission.
Exchange Impersonation permission can be removed using the
Remove-ManagemntRoleAssignment command.
[Details on Remove-ManagemntRoleAssignment can be found here]
Microsoft Dynamics CRM
Configure users and queues to use Microsoft Dynamics CRM E-mail Router.
Users and Queues in CRM can be configured to use the E-mail Router for processing the incoming Exchange and outgoing CRM e-mails. To utilize this functionality, Users and Queues must have a valid email address and select E-mail Router as the incoming and outgoing E-mail access types. This can be setup by an administrator or users having relevant permissions.
CRM Users
1. Navigate to Settings->Administration->Users and configure the user record as displayed.
clip_image002
  1. Individual users can select which e-mails from the specified Exchange On-Premise mailbox to Track in CRM. This can be selected from the Tools->Options-> E-mail tab.
clip_image003
CRM Queues
  1. Navigate to Settings->Business Management->Queues and configure the Queue as displayed.
    clip_image004
  1. In line with Users, Queue form also provides the flexibility to choose the desired category of e-mails which need to be promoted to Microsoft CRM.
    clip_image005
Microsoft Dynamics CRM 4.0 E-mail Router (On-Premise)
After the Router has been installed, launch the E-mail Router Configuration Manager from Start-> All Programs-> Microsoft Dynamics CRM E-mail Router. There are three main tabs in the Configuration Manager as shown below.
clip_image007
Configuration Profiles. To configure the E-mail Router, you first create one or more incoming and one or more outgoing configuration profiles. These configuration profiles contain information about the e-mail server and authentication methods that the E-mail Router will use to connect to the e-mail server and transfer e-mail messages to and from the Microsoft Dynamics CRM organization. You create configuration profiles on the Configuration Profiles tab in the E-mail Router Configuration Manager.
Deployments. After you create the configuration profiles that you want, you must define at least one deployment. The information that you enter into the Deployment area will be used by the E-mail Router to connect to your Microsoft Dynamics CRM deployment.
Users, Queues and Forward Mailboxes. After you have the configuration profiles and deployment established, then you manage the users, queues, and forward mailboxes that will be used by the E-mail Router to route Microsoft Dynamics CRM e-mail messages. You manage these items on the Users, Queues, and Forward Mailboxes tab in the E-mail Router Configuration Manager.
Creating Exchange Server 2010 incoming profile.
  1. In the E-mail Router Configuration Manager tool, click the Configuration Profiles tab, and then click New.
  2. Type a profile name. For example, type Exchange 2010 Incoming Email.
  3. Choose Incoming in the Direction list.
  4. Choose Exchange Web Services as the Protocol.
  5. Choose Exchange 2010 as the E-mail Server Type.
  6. The only Authentication Type allowed is “Windows Authentication”.
  7. Type the name of the Microsoft Exchange Server 2010 web services URL.
Default Location
https://<Exchange-2010-Server-Name>/EWS/Exchange.asmx
clip_image008
8. Select how the e-mail Router will gain access to the Microsoft Exchange Server 2010 in the Access Credentials list.
  • If you select Local System Account for the Profile, the Router will use the credentials specified in the Microsoft CRM Email Router service running in the host machine. The credentials provided should be the username of user in your Microsoft Dynamics CRM organization who has the System Administrator role. This user must have Exchange Impersonation permission on the mailboxes that this Incoming Profile will serve including self. This type of profile is typically used for polling large number of mailboxes using the credentials of a user with Administrative privileges and Exchange Impersonation permissions.
  • If you select User Specified for the Profile, the Router will use the user name and password provided in Microsoft Dynamics CRM for users who are configured to use this Incoming Profile.
  • If you select Other Specified for the Profile, the Router will use the user name and password provided in the open textboxes as shown below. User name has to be provided in the form DomainName\UserName. The specified user must have Exchange Impersonation permission on all the mailboxes that this Incoming Profile will serve (Exchange Impersonation Permissions on self is not required).
Note: The above steps can also be used to create an incoming profile for a CRM user having Microsoft Exchange Server 2007 mailbox by choosing Exchange 2007 as the Email Server Type in step 5.
Creating Exchange Server 2010 outgoing profile.
Microsoft Dynamics CRM 4.0 Email Router (On-Premise) with Update Rollup 8 supports SMTP as the default and only protocol for outgoing e-mail messages as in the case of previous versions.
  1. In the E-mail Router Configuration Manager tool, click the Configuration Profiles tab and then click New.
  2. Type a profile name. For example, type Exchange 2010 Outgoing Email.
  3. Choose Outgoing in the Direction list.
  4. The only Protocol allowed is SMTP.
  5. Verify that SMTP is selected as the E-mail Server Type.
  6. Choose the Authentication Type as appropriate.
clip_image009
  1. Type only the name of the Microsoft Exchange Server 2010 system in the Location field.
  2. Check SSL box if the Microsoft Exchange Server 2010 uses SSL for SMTP.
  3. Select and provide the appropriate Access Credentials with Exchange Impersonation permission as required. [See section on Granting Exchange Impersonation permission for details]
Configure the Microsoft Dynamics CRM On-Premise deployment.
After you have created the outgoing and incoming e-mail profiles, click the Deployments tab in the E-mail Router Configuration Manager tool.
  1. Click New to create a new deployment. The default Deployment option will be set to My Company.
  2. In the Microsoft Dynamics CRM Server open text box it will default to http://discovery/<OrganizationName>. Replace discovery with the name of the Microsoft Dynamics CRM On-Premise Server and <OrganizationName> with your Microsoft Dynamics CRM Organization Unique Name.
    Note: The Organization Unique Name is case-sensitive.
  3. Verify that Microsoft Dynamics CRM secure URL Port contains valid value if the CRM server is SSL enabled. clip_image010
  1. Select how the e-mail Router will gain access to the Microsoft Exchange Server 2010 in the Access Credentials list.
    • If you select Local System Account, the Router will use the credentials specified in the Microsoft CRM Email Router service running in the host machine.
    • If you select Other Specified, the Router will use the user name and password provided in the open textboxes as shown below. User name has to be provided in the form DomainName\UserName.
    5. In the Incoming configuration profile, select the incoming profile you created.
  1. In the Outgoing configuration profile, select the outgoing profile you created.
    Note: Setting the Incoming and Outgoing configuration profiles on the Deployment will make these the default profiles for the users that are set to use the E-mail Router for incoming and outgoing e-mail. You can change it for each user in the Users, Queues and Forward Mailboxes tab.
  2. Click OK to finish creating the deployment.
Forward Mailbox
Forward Mailbox is one of the options available for processing the incoming e-mails in Microsoft CRM. This option is helpful in scaling the system where all the Forward Mailbox users and queues have all their e-mails forwarded to the Forward Mailbox using Exchange forwarding rules. Emails for multiple users and queues are present in this single E-mail box as an attachment and hence Router can promote them to Microsoft Dynamics CRM using the single polling location. Users and Queues can have this options set for incoming e-mails processing as follows.
  • Users: Settings->Administration->Users
  • Queues: Settings->Business Management-> Queues
clip_image012
Set up the Forward Mailbox.
  1. Open the Microsoft Dynamics CRM E-mail Router Configuration tool.
  2. Click the Users, Queues and Forward Mailboxes tab.
  3. In the Select a CRM Deployment to view users and mailboxes list, select the Microsoft Dynamics CRM deployment you created.
clip_image013
  1. Click Load Data. This will display the Microsoft Dynamics CRM users who are configured to use the Email Router for processing their e-mails.
    Note: If you receive an error displaying the users, verify the correct organization name is listed in the Select a CRM Deployment to view users and mailboxes list. Also, verify the organization name is entered with the correct case. The organization name is case-sensitive.
    Note: If no users are listed after you click Load Data, or if you are missing users, check the user’s settings by following the steps in the section titled “Configure users and queues to use Microsoft Dynamics CRM E-mail Router.”
  2. Click the Forward Mailboxes tab, and then click the New.
  3. Type a name for the forward mailbox profile. For example type ForwardMailbox in the Name open text box.
  4. Type the e-mail address for the forward mailbox in the E-mail Address open text box.
  5. Click OK
Deploy Exchange rules manually through Microsoft Exchange Server 2010.
In order to use the forward mailbox feature Microsoft Exchange Server 2010 users need to manually create rules on their own mailboxes from OWA or using Outlook client. This can be done by using the Rule Deployment Wizard for Microsoft Exchange Server 2007 and earlier systems. In Microsoft Exchange Server 2010 they will need to manually setup a rule with the following logic:
clip_image014
Forward All e-mails as An Attachment to <a mailbox you defined in your system>
This rule will forward all incoming e-mail to the Microsoft Dynamics CRM forwarding mailbox. After the rules have been deployed, any e-mail that is received in a user’s mailbox will be forwarded as an attachment to the forwarding mailbox. The Microsoft Dynamics CRM E-mail Router Service monitors the forward mailbox. The service will route Microsoft Dynamics CRM e-mail to Microsoft Dynamics CRM as an e-mail activity. If the e-mail is not related to Microsoft Dynamics CRM, the service will delete the e-mail message from the forwarding mailbox.
Test and publish the new incoming /outgoing profiles and deployment.
The final step is to publish new incoming profiles, the deployment and forward mailbox settings. Before publishing, connectivity to all mailboxes using the specified profiles must be tested. To do this, complete the following steps:
  1. Click the Users, Queues and Forward Mailboxes tab within the E-mail Router Configuration Manager tool.
  2. In the Select a CRM Deployment to view users and mailboxes list, select the Microsoft Dynamics CRM deployment you created.
  3. Click Load Data. This will display the Microsoft Dynamics CRM users configured to use the e-mail Router. clip_image015
Note: If you receive an error loading the data, verify the correct organization unique name is listed in the Select a CRM Deployment to view users and mailboxes list. Also, verify the organization unique name is entered with the correct case. The organization unique name is case sensitive. If no users are listed after you click Load Data, or if you are missing users, check the user’s settings. Also Forward Mailbox users and queues do not have the option of assigning the incoming profiles because the forward mailbox is directly used for the incoming E-mail processing.
  1. If you want to change the Incoming or Outgoing configuration profiles for certain users, double click the user and change the selection for the Incoming Configuration Profile or Outgoing Configuration Profile and click OK.
  2. Click Test Access. Tests will be performed on all users for both profiles. A successful test will display a green succeeded message that resembles the following:
    clip_image016
  3. To publish the deployment, click Publish. A successful publish will display the following message: 
clip_image018
On publishing the Router will start catering the Microsoft CRM Users and Queues having the Microsoft Exchange Server 2010 mailboxes.
Cheers,


 [http://blogs.msdn.com/crm/archive/2009/12/21/how-to-configure-microsoft-dynamics-crm-4-0-e-mail-router-on-premise-with-microsoft-exchange-server-2010.aspx]

Tuesday, March 2, 2010

Change Dynamics CRM 4.0 Logo

I've been asked to change a certain organization logo, and I've googled it and found the same result:



although this is still not a supported customization, it's still doable. referencing from Cesar de la Torre blog, here are the ways to do it.
1. change the image file at [C:\Program Files\Microsoft CRM Server\CRMWeb\_imgs\masthead.jpg] and you are done.
or
2. modify the css definition [TD.ms-crm-MastHead-Logo] at [C:\Program Files\Microsoft CRM Server\CRMWeb\_common\styles\global-dynamic-styles.css.aspx] file.
be sure to backup those settings when you are upgrading to new versoin of CRM or applying a patch, since the update might then overwrite your files and lost your logo custimization.
 --------------------------- this is the end for the post I found,

but the above solution actually changes the logo for all organizations, to change it for certain organization you can navigate to [C:\Program Files\Microsoft CRM Server\CRMWeb\_common\styles\global-dynamic-styles.css.aspx] file and start editing the class TD.ms-crm-MastHead-Logo to include the organization check:

<% if (Request.Url.ToString().ToLower().Contains("<your custom organization name>")) { %>
background-position: top right;
background-image: url(/_imgs/<your custom logo>.jpg);
<% } else { %>
background-position: top left;
background-image: url(/_imgs/masthead.jpg);
<% } %>

and you can do the same for the CSS class for the rest of the colors and backgrounds.

Many to Many Relationship IFrame

you can display the N-N Relationship view or any other view in CRM entity in IFrame like this:


to do this, I am creating two test entities new_testentity1 and new_testentity2 and many to many relationship between the two entities, and IFrame in new_testentity1  named IFRAME_TestEntity2
and form onload script:

function OnCrmPageLoad() {
            /* Create a N2NViewer and give it the IFRAME (container) id */
            var n2nViewer = new N2NViewer('IFRAME_TestEntity2');
            /* Set the role order - use iedevtoolber for exact parameters */
            n2nViewer.RoleOrder = 1;
            /* assing the relationship name (without the "area" word) */
            n2nViewer.TabsetId = "new_new_testentity1_new_testentity2";
            /* Do the trick... */
            n2nViewer.Load();
        }

        function N2NViewer(iframeId) {
            if (!document.all[iframeId]) {
                alert(iframeId + " is missing!");
                return;
            }

            var viewer = this;
            var _locAssocObj = null;

            viewer.IFRAME = document.all[iframeId];
            viewer.RoleOrder;
            viewer.TabsetId;

            viewer.Load = function() {
                /* Construct a valid N2N IFRAME url */
                viewer.IFRAME.src = "areas.aspx?oId=" + crmForm.ObjectId + "&oType=" + crmForm.ObjectTypeCode + "&security=" + crmFormSubmit.crmFormSubmitSecurity.value + "&roleOrd=" + viewer.RoleOrder + "&tabSet=area" + viewer.TabsetId;
                viewer.IFRAME.onreadystatechange = viewer.StateChanged;
            }

            viewer.StateChanged = function() {
                if (viewer.IFRAME.readyState != 'complete') {
                    return;
                }

                var iframeDoc = viewer.IFRAME.contentWindow.document;

                /* Reomve scrolling space */
                iframeDoc.body.scroll = "no";
                /* Remove crmGrid Default padding */
                iframeDoc.body.childNodes[0].rows[0].cells[0].style.padding = 0;

                /* Save MS locAssocObj */
                _locAssocObj = locAssocObj;
                /* Override MS locAssocObj */
                locAssocObj = viewer.locAssocObj;
            }

            viewer.locAssocObj = function(iType, sSubType, sAssociationName, iRoleOrdinal) {
                /* Open the Dialog */
                _locAssocObj(iType, sSubType, sAssociationName, iRoleOrdinal);
                /* Refresh only if our iframe contains the correnct tabset name */
                if (sAssociationName == viewer.TabsetId) {
                    viewer.IFRAME.contentWindow.document.all.crmGrid.Refresh();
                }
            }
        }

        //Entry Point
        OnCrmPageLoad();

Saturday, February 27, 2010

Creating Custom Buttons in CRM Toolbars

To Create Custom Button in the CRM 4.0 Toolbar, you need to export the ISV.config file and under Entities node you need to add the following XML for your targeted entity i.e. new_project

<Entity name="new_project">
<ToolBar ValidForCreate="0" ValidForUpdate="1">
<Button Icon="/_imgs/ico_18_debug.gif" JavaScript="ConvertToProject();">
<Titles>
<Title LCID="1033" Text="Convert To Project" />
</Titles>
<ToolTips>
<ToolTip LCID="1033" Text="Convert To Project" />
</ToolTips>
</Button>
<ToolBarSpacer />
</ToolBar>
</Entity>


where ConvertToProject(); is the javascript function you want to execute on the button click and it should be defined in your form onload


One more thing, you need to add the clients in system setting > Customization tab  to see the samples from ISV.

enjoy :)

Change the Attributes, Sections and Tabs Colors in CRM 4.0

To change the color, bac for the CRM control (Attribute, Section or Tab), you just need to get the control and set the property you want:

document.getElementById('new_name').style.background= 'red';

or visibility:
document.getElementById('new_name').style.display= 'none';

or width
document.getElementById('new_name').style.width= '100';


Wednesday, February 10, 2010

Error: Invalid User Authorization. The user authentication passed to the platform is not valid

If you receive this error in CRM 4.0, defintely it's a Rollup update and Active Directory Issue.

I've seen this with CRM 4.0 and Windows Server 2008 R2

I had this error and googled it and found a lot of posts, some of them comparing the users in the config db with the organization db, others asking for restarting the Microsoft CRM Asynchronous Processing Service

Nothing of the posted solutions worked with me, so I uninstalled the rollup update 7 and it's working fine.

so I tried it with Rollup updates 8,7,6,5,4,3

Only Rollup update 3 solved all my problems and worked like a charm.

Update: Make sure to give the network service user crm read role on the organization and configuration databases.

Monday, January 18, 2010

Installing Project Server 2007 on Windows Server 2008

If you try to install Project Server 2007 on Windows Server 2008 with Service Pack 2, the Setup program will give you an error message such as this one:

“The program is blocked due to compatibility issues.”

The solution for this error is the same as the solution for a similar error with SharePoint Server 2007 – you need to slipstream the latest service pack files into your Project Server installation (the SharePoint solution was described by Martin Kearn here.)

To successfully load Project Server 2007 on Windows Server 2008 SP2, follow these steps:

1. Copy Project Server 2007 installation files from the CD to a local directory on your hard drive, such as C:\Project2007.

2. Download Project Server 2007 SP2 files from this location:

http://www.microsoft.com/downloads/details.aspx?FamilyID=b7816d90-5fc6-4347-89b0-a80deb27a082&displaylang=en.

Choose the appropriate download for your architecture (32-bit or 64-bit).

3. From the command prompt, extract the update files to a local folder using /extract switch. Example: c:\ProjectServer2007sp2-kb953334-x86-fullfile-en-us.exe /extract:c:\Project2007SP2\

4. Copy the extracted SP2 files to /Updates directory in the Project Server 2007 installation folder on your hard drive.

5. You can now install Project Server 2007 on Windows Server 2008 SP2.



Source: http://sharepointnomad.wordpress.com/2009/09/16/installing-microsoft-office-project-server-2007-on-windows-server-2008-sp2/

Update:  the link above now contains SharePoint 2007 SP2 and it applies for Project Server 2007 as SP2 too, and the command will be: officeserver2007sp2-kb953334-x64-fullfile-en-us.exe /extract:c:\Project2007SP2\

Sunday, January 3, 2010

Microsoft and SAP Again Team Up Against Oracle

By Ben Worthen
As tech companies expand into one another’s turf, rivalries are often created or intensify. So it should come as no surprise to see some deals that can be summed up as the enemy of my enemy is my friend.


SAP and Microsoft, which dominate different segments of the software industry, are set to announce the latest such partnership on Wednesday. Under the agreement, Microsoft will name the German software maker the “preferred provider” to its customers of software for budgeting, planning and forecasting.

The deal extends a longstanding relationship between the two companies, whose past collaborations include software to help their programs work better together. Microsoft even considered making a bid to buy SAP early in the decade.

SAP and Microsoft also have some overlap. For instance, both make software that businesses use to do things like balance the general ledger and manage customer relationships. The other thing that they have in common: an intense dislike of Oracle.

Oracle is SAP’s biggest rival for business application software and Microsoft’s biggest rival for database software. Oracle also makes a budgeting and planning program that competes with the SAP software at the heart of the new partnership.

The Oracle competition seems to trump concerns that working together might give SAP a foot into Microsoft’s accounts. By working together Microsoft and SAP hope that they will better be able to win sales against Oracle—and replace it in some cases, says Sanjay Poonen, an executive at SAP.

Under the arrangement SAP and Microsoft will make joint sales calls and appear at events together, says Poonen. They’ll also take steps to ensure that products from the two companies work well together.

An Oracle spokeswoman declined to comment.

Source: http://blogs.wsj.com/digits/2009/11/17/microsoft-and-sap-again-team-up-against-oracle/?mod=msn_money_ticker

Saturday, January 2, 2010

CRM 4.0 Export Report to Word (.Doc) Format

I was trying to export CRM 4.0 Reports to word files using SSRS 2005 and after googling it I found a post From Ronald here but didn't go through it as I found it is supported out of the box in SSRS 2008,



So, it's time to upgrade to SQL 2008 :).