الثلاثاء، 19 مارس 2013

Could not load type System.ServiceModel.Activation.HttpModule


  • This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.
    To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:

    1- Open Visual studio command prompt.
    2- write this command aspnet_regiis.exe -iru

السبت، 9 فبراير 2013

CRM 2011:The import file is too large to upload.

The error indicates that the file size was above the default max import file size of 8 MB. In order to change 
the default setting please apply the following steps.

Step 1:-

1.Click Start, click Run, type regedit, and then click OK.
2.Locate the following registry subkey:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ MSCRM

3.Right-click MSCRM, point to New, and then click DWORD Value to create a new DWORD value.
4.Rename the DWORD value to the following value:
OLEDBTimeout

5.Right-click the DWORD value, and then click Modify.
6.In the Edit DWORD Value dialog box, type 86400 in the Value data box, click Decimal in the Base option, and then click OK. 

7.Right-click MSCRM, point to New, and then click DWORD Value to create a new DWORD value.
8.Rename the DWORD value to the following value:
ExtendedTimeout

9.Right-click the DWORD value, and then click Modify.
10.In the Edit DWORD Value dialog box, type 1000000 in the Value data box, and then click OK. 

--------------------------------------------------
a- Open Web.Config file for CRM web Application
  1. locate the following line.

    <httpRuntime executionTimeout="300" maxRequestLength="8192"/>
    Change executionTimeout="3600" and change maxRequestLength="20000".
    then locate the following line.
    1. <httpRuntime maxRequestLength="8192"/>
    Change maxRequestLength="20000".
    Save and then close the Web.config file.

Step 2:-    

Verify the current value for the "Max" file size for data upload. By default the value is set to "8".

Use MSCRM_CONFIG
select ColumnName, IntColumn from ServerSettingsProperties
where ColumnName = 'ImportMaxAllowedFileSizeInMB'
Go 

change the default value from 8 to 12.

Use MSCRM_CONFIG
UPDATE [MSCRM_CONFIG].[dbo].[ServerSettingsProperties]
SET [IntColumn] = '12'
WHERE ColumnName = 'ImportMaxAllowedFileSizeInMB'
Go

الاثنين، 14 يناير 2013

How To Solve this Problem:a potentially dangerous request.form value was detected from the client...

1- added the following to the existing "page" directive in that .aspx file.
ValidateRequest="false"
2-add requestValidationMode="2.0" to the httpRuntime configuration section of the web.config file like the following:
 <httpRuntime requestValidationMode="2.0"/> 

الثلاثاء، 8 يناير 2013

How To Get Lookup ID,Name and EntityType in CRM 2011

First Write a function to get lookup
    function GetLookup(FieldName) {
    var lookup = Xrm.Page.data.entity.attributes.get(FieldName)
    if (lookup == null) { return null; };
    var lookupObj = lookup.getValue();
    return lookupObj[0];     
 }

1- To Get Lookup Id.
    function GetLookupId(fieldName) {
    var lookup = GetLookup(fieldName);
    if (lookup != null) {
        return lookup.id;
      }
    return null;
  }

2- To Get Lookup Name.
 function GetLookupName(fieldName) {
    var lookup = GetLookup(fieldName);
    if (lookup != null) {
        return lookup.name;
      }
    return null;
  }

3- To Get Lookup Entity Type. 
    function GetLookupEntityType(fieldName) {
    var lookup = GetLookup(fieldName);
    if (lookup != null) {
        return lookup.entityType;
      }
    return null;
  }

الأحد، 6 يناير 2013

How to: Install and Uninstall Windows Services

* To  Install Or Uninstall Windows Services open Visual studio command Prompt and write this command
      Cd  D:\WindowsService\WindowsService\bin\Debug  
 (Path of WindowsService.exe) then.
1-To Install Windows Service write this Command
           installutil WindowsService.exe
2- To Uninstall Windows Service write this Command
          installutil /u  WindowsService.exe

الاثنين، 31 ديسمبر 2012

Sql Server Error:A connection was successfully established with the server, but then an error occurred during the login proces

To Solve this Error do the following:
1-Open SQL Server Management Studio and login
2-From Server Name right click and Select properties



















3-Select Security in left menu and set server authentication to SQL Server and Windows Authentication.
3-Stop SQl service(MSSQLSERVER) and Start it again.
4- Open SQL Server Management Studio. Do not login, cancel the login dialog.
5- From the file Menu select New->Database engine query, and login(windows Authentication).
6-Execute the query ALTER LOGIN sa WITH PASSWORD = ''; to reset the password (if the sa is not enabled then type ALTER LOGIN sa ENABLE to do so).
7-Login with the sa user and add the Administrator user.