jueves, 1 de diciembre de 2011

xmlhttp request CRM, for a webservice Method.

function xmlCall(url)
{
alert('xmlCall ini ' + url );
   var xmlDoc;
   var xmlhttp;
  
    if (window.XMLHttpRequest)
    {
alert('XMLHttpRequest ini ' + url );
        xmlhttp=new XMLHttpRequest();
alert('XMLHttpRequest after'  );
    }
    else
    {
alert('Else XMLHttpRequest'  );
        try
        {
            xmlhttp=new ActiveXObject("MSXML2.ServerXMLHTTP");
        }
        catch (e) {}
        try
        {
            xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.6.0");
        }
        catch (e) {}
        try
        {
            xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.3.0");
        }
        catch (e) {}
        try
        {
            xmlhttp=new ActiveXObject("MSXML2.XMLHTTP");
        }
        catch (e) {}
        try
        {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e) {}
        throw new Error("This browser does not support XMLHttpRequest.");
    }
alert('xmlhttp.open ini');
    xmlhttp.open("GET",url,false) ;
alert('xmlhttp.open after');
    try
    {
alert('xmlhttp.send ini');
        xmlhttp.send();
alert('xmlhttp.send after');
        var i = 0;
        var xmlDoc = xmlhttp.responseXML;
        for (i = 0; i < xmlDoc.getElementsByTagName('ROWID').length; i++) {
            alert('Id:' + xmlDoc.getElementsByTagName('ROWID')[i].firstChild.nodeValue);
            alert('descr:' + xmlDoc.getElementsByTagName('descr')[i].firstChild.nodeValue);
        }
    }
    catch (e) { alert('Error de lectura ' + e.message + 'en ' + url); };
    xmlDoc = xmlhttp.responseXml;
}
xmlCall( 'http://server/service.asmx/GetCountry');

How to load a .js File to Dynamics CRM


   function load_script (url) 
     { 
        var x = new ActiveXObject("Msxml2.XMLHTTP"); 
         x.open('GET', url, false); x.send(''); 
       eval(x.responseText); 
        var s = x.responseText.split(/\n/); 
         var r = /^function\s*([a-z_]+)/i; 
        for (var i = 0; i < s.length; i++) 
         { 
           var m = r.exec(s[i]); 
            if (m != null) 
                window[m[1]] = eval(m[1]); 
        } 
   } 
     
    load_script("/_customscript/jquery-1.2.6.min.js"); 
    load_script("/_customscript/jqModal.js"); 
    load_script("/_customscript/jqDnR.js"); 
    load_script("/_customscript/customscript.js"); 

lunes, 31 de octubre de 2011

# Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObjectModel, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified

 You can try copying the ReportViewer assemblies manually. Normally if the ReportViewer.exe successfully completes the setup process, the following files should be placed within the following folder :
C:\Program Files\Microsoft Visual Studio 8\ReportViewer or
C:\Program Files\Microsoft Visual Studio 9.0\ReportViewer




  • Microsoft.ReportViewer.Common.dll
  • Microsoft.ReportViewer.WebForms.dll
  • Microsoft.ReportViewer.WebForms.xml
  • Microsoft.ReportViewer.WinForms.dll
  • Microsoft.ReportViewer.WinForms.xml





  • You can manually copy the following dll files into the application folder /bin directory. After copying the files into the application bin folder the web application will start responding successfully. And ASP.NET ReportViewer control will work on your web application.

    Bytes!! :)

    miércoles, 12 de octubre de 2011

    Solomon Crystal reports printer error 513: Printer undefined


    The 513 error message usually occurs when Dynamics SL cannot find the printer. 
    If the printer appears to be fine, then try logging out of Dynamics  log back into Dynamics SL
    and test printing.

    You might want to check your Windows Default printer to make certain that there are no issues. You might also delete and recreate your printer in case the printer corrupted.
    
    
    Or if yu're using Citrix check if the name of printer is too long and try to put a short name, and it work's.
    
    
    bytes,

    domingo, 9 de octubre de 2011

    Troubleshooting: Common failure reasons while deploying applications to the BlackBerry PlayBook simulator


    As described in the BlackBerry Tablet OS Application development guides (Getting Started – Adobe AIRGetting Started - BlackBerry WebWorks), deploying an *.bar BlackBerry® PlayBook™ Tablet application to the BlackBerry® Tablet Simulator requires the following 2 steps:


    1. Enable development mode on the target Simulator
    2. Use the blackberry-deploy service, found within the BlackBerry® Tablet OS SDK, to deploy your *.bar application to the simulator:
    or If You're trying with Flash Builder, and get an error like this:

    actual_id::MjA5OGRhZTZkMDY2MmUxICAgICA
    actual_version::1.0.0.0
    result::failure
    Error: Connection to 192.168.198.137 refused.
    Cannot connect:Connection to https://192.168.181.129 refused. Please check Ip address settings for the target. You May have to reboot the target.

    Go to the command promt and type ping to your playbook simulator

    Enable your VMware NetWork Adapter. 
    Go again to the command promt and type ping to your playbook simulator

    That's all . 

    bytes. !!

    miércoles, 14 de septiembre de 2011

    How to get GPS data from Playbook and save in a File and read it.

    import flash.sensors.Geolocation;
    import flashx.textLayout.factory.StringTextLineFactory;
    import mx.events.FlexEvent;
    import qnx.media.QNXStageWebView;
    private var geoLocation:Geolocation;
    private var ObjfiletoSave:File;
    private var Objstream:FileStream = new FileStream();
    private var Objstream2:FileStream = new FileStream();
    private var Count:Number =0;
    private var Coord: String="";

    protected function application1_applicationCompleteHandler(event:FlexEvent):void {
    lectura.text="file applicationdirectory: "+File.applicationDirectory.nativePath +"\n"
    +"file applicationStorageDirectory: "+File.applicationStorageDirectory.nativePath +"\n"
    +"file desktopDirectory: "+File.desktopDirectory.nativePath +"\n"
    +"file documentsDirectory: "+File.documentsDirectory.nativePath +"\n"
    +"file userDirectory: "+File.userDirectory.nativePath +"\n"
    // TODO Auto-generated method stub
    if(Geolocation.isSupported==true){
    geoLocation = new Geolocation();
    geoLocation.setRequestedUpdateInterval(1000);
    geoLocation.addEventListener(GeolocationEvent.UPDATE,handleLocateRequest);
    }else{
    status.text="No soporta Geolocalización!"
    }
    }
    private function handleLocateRequest(event:GeolocationEvent):void{
    var mph:Number = event.speed * 2.23693629;
    var kph:Number = event.speed * 3.6;
    info.text="Actualización: " + new Date().toTimeString() + "\n\n"
    + "latitud: " + event.latitude.toString() + "\n"
    + "longitud: " + event.longitude.toString() + "\n"
    + "altitud: " + event.altitude.toString() + "\n"
    + "speed: " + event.speed.toString() + "\n"
    + "speed: " + mph.toString() + "\n"
    + "speed: " + kph.toString() + "\n"
    + "cabecera: " + event.heading.toString()+ "\n"
    + "horizontal accuracy: " + event.horizontalAccuracy.toString() + "\n"
    + "vertical accuracy: " + event.verticalAccuracy.toString() ;
    SaveinTextFile(event.latitude.toString(),event.longitude.toString());
    }

    private function SaveinTextFile(Latitud:String,Longitud:String):void{
    var Fecha:String = new Date().toTimeString();
    ObjfiletoSave=File.documentsDirectory.resolvePath("samples/GPS.txt");
    status.text="Salva Lectura de " + File.documentsDirectory.nativePath + "/samples/GPS.txt";
    Objstream.open(ObjfiletoSave, FileMode.APPEND);
    Objstream.writeUTFBytes("var Count"+ Count.toString() +"=new GLatLng("+ Latitud + "," + Longitud + "); \n" )
    Coord= Coord + "Count" + Count.toString()+",";
    Count ++;
    }

    private function ReadTextFile():void{
    ObjfiletoSave=File.documentsDirectory.resolvePath("samples/GPS.txt");
    status.text="Lectura de " + File.documentsDirectory.name + "/samples/GPS.txt";
    var Objstream2:FileStream = new FileStream();
    Objstream.open(ObjfiletoSave, FileMode.READ);
    lectura.text = Objstream.readUTFBytes(Objstream.bytesAvailable);
    Objstream.close();
    //status.text="Lectura..." }
    protected function detener_clickHandler(event:MouseEvent):void
    {
    // TODO Auto-generated method stub
    geoLocation.removeEventListener(GeolocationEvent.UPDATE,handleLocateRequest);
    status.text="Lectura detenida";
    Objstream.writeUTFBytes(Coord );
    Objstream.close();
    }

    protected function mostrar_clickHandler(event:MouseEvent):void {
    // TODO Auto-generated method stub
    ReadTextFile();
    }

    protected function continua_clickHandler(event:MouseEvent):void {
    // TODO Auto-generated method stub
    geoLocation = new Geolocation();
    geoLocation.setRequestedUpdateInterval(1000);
    geoLocation.addEventListener(GeolocationEvent.UPDATE,handleLocateRequest);
    }