Plugin Deployment Options – Dynamics CRM

The 3 storage options are: Database, Disk and GAC. The main differences between these are:

Database: The assembly dll is stored in the database, rather than the file system. The major advantages are that the assembly need only be deployed once multiple CRM servers are available, and that no additional action is required to restore / redeploy the assembly either during disaster recovery, or if redeploying to an alternate server. This is the preferred option in a production environment

Disk: The assembly dll is placed in the \server\bin\assembly directory on each server. Have to ensure the dll is placed in the correct place on all CRM servers, so the deployment overhead is a little greater. Better to use this option in development environments as the developer can redeploy newer versions solely by file transfer, rather than reregistering. Also, if debugging, the assembly .pdb file needs to be placed in the same location; with this option it’s easy to ensure the dll and pdb are from the same build

GAC: The assembly is placed in the Global Assembly Cache on each CRM server, and again will have to do this. The GAC does allow multiple versions of an assembly, but CRM doesn’t, so don’t really gain anything by using the GAC.

According to my experience deploying the plugin assemblies to the Database is the best option as we can backup and restore the databases and minimizing assemblies deployments and other setting changes.

Advertisements

Application Pool Recycling instead of Restarting IIS – CRM App Pool

Restarting or stopping IIS, or rebooting the Web server, is a server action. When restarting the Internet service, all sessions connected to the Web server (including Internet, FTP, SMTP, and NNTP) are dropped. Any data held in Web applications is lost. All Internet sites are unavailable until Internet services are restarted. For this reason, we should avoid restarting, stopping, or reboot the server if at all possible. IIS 6.0 includes application pool recycling and several other features that provide alternatives to restarting IIS. For a list of features designed to improve IIS reliability and remedy the need to restart IIS.

Restarting IIS (IIS 6.0)

All of the Internet services listed below, if installed, are affected when restarting IIS

Service Description
IIS Admin service This service manages all the services of IIS other than the WWW service (FTP, NMTP, and SMTP).
WWW service This service provides Web connectivity between clients and Web sites.
HTTP SSL service This service provides secure Web connectivity between clients and Web sites.
FTP service This service provides FTP connectivity and administration through IIS Manager.
SMTP service This service transports electronic mail across the network.
NNTP service This service transports network news across the network.

Internet Information Services (IIS) can be configured to periodically restart worker processes assigned to an application pool, which recycles faulty Web applications. Following example shows how to do it manually or using a batch file in a CRM environment.

Continue reading “Application Pool Recycling instead of Restarting IIS – CRM App Pool”

Set CRM Date Field to Empty

I have a check box and a date field on the form. The requirement is to display the System Date in the date field when the check box is checked by the user and to clear the date field when the check box is unchecked by the user. Although the user has unchecked the check box and saved the form it displays the previously saved date by the user. I used the following code to save it.

Following code will solve the problem and will set it to Empty when it saved.

      //get the value of Reviewed by Manager checkbox
    var ReviewedManager = crmForm.all.cpms_reviewedbymanager.DataValue;

    //if Reviewed by Manager chekbox is checked
    if (ReviewedManager == true)
    {
        //set the Date Reviewed by  to system date
        crmForm.all.cpms_datereviewedbymanager.Disabled = false;
        crmForm.all.cpms_datereviewedbymanager.DataValue = new Date();
    }
    else
    {
        crmForm.all.cpms_datereviewedbymanager.DataValue = null;
        crmForm.all.cpms_datereviewedbymanager.ForceSubmit = true;
        crmForm.all.cpms_datereviewedbymanager.Disabled = true;
    }