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