Wednesday, March 16, 2011

Override Add Existing ISV Button functionality in CRM

To override "Add Existing" button default functionality. An Iframe displays accounts assoiciation view. Here I will be adding an confirm alert message to the "Add Existing" button, if the user confirms it will opens the lookup window, otherwise no action will happen.

     Add the following java script code in page load of the entity

getAlertForAddExistingAccountButton = function(lookupUrl) {  
    var iframe = crmForm.all.IFRAME_Accounts; //  IFRAME_Accounts  ID  
    var crmGrid = iframe.contentWindow.document.all['crmGrid'];  

  // If it's not N:N lookup dialog, we skip it.   
    if (lookupUrl.toLowerCase().match(/\/_controls\/lookup\/lookupmulti.aspx/i) == null)  
        return lookupUrl;  
    // If the lookup window is not concerned with the entity that we are interested in, we skip as well  
    if (GetQueryString(lookupUrl, 'objecttypes') !== crmGrid.GetParameter('otc'))  
        return lookupUrl;  
    return lookupUrl;  

(function replaceCrmLookups() {  

    window.oldOpenStdDlg = window.oldOpenStdDlg || window.openStdDlg;  

    window.openStdDlg = function() {  
var cnf = confirm("Are you sure to open Account lookup? ");

        arguments[0] = getAlertForAddExistingAccountButton(arguments[0]);  
        return oldOpenStdDlg.apply(this, arguments);  


Now you will get confirm alert on add existing button click before opening the account lookup page.

Friday, March 4, 2011

Step by Step: Upgrading CRM 2011 RC – CRM 2011 RTM

  1.                  Uninstall the RC

Uninstall CRM 2011 RC using add or remove programs

Uninstallation of CRM 2011 RC has been finished.

 2.       Install to existing databases using the RTM bits

Now run the CRM 2011 RTM installation wizard

CRM 2011 RTM installation finished.

Now download the RTM Patch (KB 2461082) Click!

 3.      Apply the RTM Patch (KB 2461082) against the RTM server. This will enable you to import      RC organizations if needed.

Installing the Outlook update patch

Installing Reporting server Extension patch

4.Run the SQL Script from KB 2461082 against any Microsoft Dynamics CRM 4.0 organizations that were upgraded to Microsoft Dynamics CRM 2011 while the server was using RC bits.

here is the SQL Script

delete from UserQueryBase where QueryType = 256 and ReturnedTypeCode = 2 and (FetchXml is null or LEN(FetchXml) = 0)

insert into UserQueryBase

(UserQueryId, Name, Description, ReturnedTypeCode, QueryType, FetchXml,

ColumnSetXml, LayoutXml, OwningBusinessUnit, ModifiedBy, ModifiedOn, CreatedBy, CreatedOn,

StatusCode, StateCode, OwnerId)

Select NEWID(), Name, Description, 2, 256, FetchXml,

ColumnSetXml, LayoutXml, OwningBusinessUnit, ModifiedBy, getutcdate(), CreatedBy, getutcdate(),

StatusCode, StateCode, OwnerId from UserQueryBase where QueryType = 16 and ReturnedTypeCode = 2 and ParentQueryId is null