Showing posts with label CRM 2011. Show all posts
Showing posts with label CRM 2011. Show all posts

Wednesday, 4 March 2015

Export more than 10000 records from Advance Find

Export more than 10000 records from Advance Find

There is a limitation of 10000 records when we export from Advance Find. Unfortunately we do not receive any message saying that this is a limitation and you are able to export only 10000.

But there is a approach to export more records.

  1. Log on to the Microsoft Dynamics CRM 3.0 server as a user who has Write permissions for the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
  2. Click Start, click Run, type regedit, and then click OK.
  3. In Registry Editor, locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM
  4. On the Edit menu, point to New, click DWORD Value, type maxrecordsforexporttoexcel, and then press ENTER.
  5. Double-click maxrecordsforexporttoexcel, click Decimal, type the maximum number of records that you want to export to an Excel worksheet, and then click OK.
  6. Close Registry Editor.
For more information refer KB Article

Happy CRM'img
Gopinath


 

Wednesday, 5 March 2014

Convert TextBox to DropDown in CRM 2011

Convert TextBox to DropDown in CRM 2011 Form

Today, we got a requirement where we don’t know the options to be populated in the dropdown as they are supposed to get from external data source. So we thought of converting TextBox to DrowDown with the values from data source in JavaScript and worked on it.

Here is the code for it…
// Conver TextBox to DropDown in CRM 2011
function CreateDropDownList() {
    //synchronous AJAX function to get Xml content from a custom webservice
    $.ajax({
        type: "POST",
        async: false,
        contentType: "application/json; charset=utf-8",
        datatype: "json",
        url: url + "/**********.asmx/*************",
        data: "{'status':'true'}",
        beforeSend: function (XMLHttpRequest) {
            //Specifying this header ensures that the results will be returned as JSON.
            XMLHttpRequest.setRequestHeader("Accept", "application/json");
            //XMLHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
        },
        success: function (XmlHttpRequest) {
            //alert(XmlHttpRequest);
            msg = XmlHttpRequest.d; //window.JSON.parse(XmlHttpRequest.responseText);
            //alert('Response ' + msg);
        },
        error: function (XmlHttpRequest) {
            var error = window.JSON.parse(XmlHttpRequest.responseText);
            //alert("Error : " + XmlHttpRequest.responseText);
        }
    });
    // Check for the browser
    try {
        if (window.ActiveXObject) {
            //Code for IE
            var Details = msg;
            var NDetails = Details.replace(/\\"/g, '\"')
            xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
            xmlDoc.async = false;
            xmlDoc.loadXML(NDetails);
        }
        else {
            // code for Mozilla, firefox, Opera, etc.
            var Details = msg;
            var NDetails = Details;
            xmlDoc = document.implementation.createDocument("", "", null);
            parser = new DOMParser();
            xmlDoc = parser.parseFromString(NDetails, "text/xml");
        }
    }
    catch (e) {
        alert(e.message);
    }
    var lsElements = xmlDoc.getElementsByTagName("Description");
    ////Erase the pick list
    var pick = document.getElementById("new_source");
    var ctName = pick.name;
    var ctId = pick.id + '_lst';
    var ctClass = "ms-crm-SelectBox";
    // Get the existing, we can use for populating it on the dropdown.
    var pVal = Xrm.Page.getAttribute("new_source").getValue();
    var parent = document.getElementById('new_source_d');
    pick.style.display = "none";
    var picklistControl = document.createElement("SELECT");
    ////Copy the Text field properties to the picklist 
    picklistControl.id = ctId;
    //// picklistControl.req = textControl.req;
    picklistControl.name = ctName;
    //// Set Required Style 
    picklistControl.className = ctClass;
    var usedNames = {};

    ////Create a new Option 
    var option = document.createElement("OPTION");
    option.value = 0;
    option.innerText = "";
    option.text = "";

    ////Add the option to the picklist   
    picklistControl.appendChild(option);
    for (vCount = 0; vCount < lsElements.length; vCount++) {
        var Source = lsElements.item(vCount).childNodes.item(0).nodeValue;
        //// Do not add duplicate options
        var isExist = false;
        if (usedNames[Source.toUpperCase()]) {
            continue;
        }
        else {
            usedNames[Source.toUpperCase()] = Source.toUpperCase();
        }
        ////Create a new Option 
        option = document.createElement("OPTION");
        option.value = vCount + 1;
        option.innerText = Source;
        option.text = Source;
        if (pVal != null && Source != null) {
            // Check if Source and Existing Value is same, just select option set selected property to True.
            option.selected = (trim(Source) == trim(pVal));
        }
        ////Add the option to the picklist   
        picklistControl.appendChild(option);
    }
    ////append the picklist to the document 
    parent.appendChild(picklistControl);
}

//

--
Happy CRM’ing,
Gopinath