الاثنين، 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.