ODATA ENDPOINT Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/odata-endpoint/ Microsoft Dynamics CRM . Microsoft Power Platform Fri, 14 Feb 2014 08:03:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 ODATA ENDPOINT Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/odata-endpoint/ 32 32 176351444 ODATA : get and set value from one entity to another (On change of look up) USING ODATA JAVASCRIPT IN MSCRM 2011 , 2013 http://microsoftdynamics.in/2014/02/14/odata-get-and-set-value-from-one-entity-to-another-on-change-of-look-up-using-odata-javascript-in-mscrm-2011-2013/ Fri, 14 Feb 2014 08:03:00 +0000 http://microsoftdynamics.in/2014/02/14/odata-get-and-set-value-from-one-entity-to-another-on-change-of-look-up-using-odata-javascript-in-mscrm-2011-2013/ function employeeonchange() {    //debugger;    //alert(‘hi’);    var lookup = new Array();    lookup = Xrm.Page.getAttribute(“new_employeename”).getValue();    if (lookup != null) {        var name = lookup[0].name;        var id=lookup[0].id;    }   //alert(name);    oDataSelect = “http://192.168.1.96/zElite/xrmservices/2011/OrganizationData.svc/new_employeeSet?$select=new_EmployeeCode,new_name”;    $.ajax({        type: “GET”,        contentType: “application/json; charset=utf-8”,        datatype: “json”,        url: oDataSelect,        beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader(“Accept”, “application/json”); },        success: function (data, textStatus, XmlHttpRequest) {            ProcessReturnedEntity(data.d.results);                   },        error:...

The post ODATA : get and set value from one entity to another (On change of look up) USING ODATA JAVASCRIPT IN MSCRM 2011 , 2013 appeared first on Microsoft Dynamics 365 Blog.

]]>

function employeeonchange() {
    //debugger;
    //alert(‘hi’);
    var lookup = new Array();
    lookup = Xrm.Page.getAttribute(“new_employeename”).getValue();
    if (lookup != null) {
        var name = lookup[0].name;
        var id=lookup[0].id;
    }

   //alert(name);
    oDataSelect = “http://192.168.1.96/zElite/xrmservices/2011/OrganizationData.svc/new_employeeSet?$select=new_EmployeeCode,new_name”;

    $.ajax({
        type: “GET”,
        contentType: “application/json; charset=utf-8”,
        datatype: “json”,
        url: oDataSelect,
        beforeSend: function (XMLHttpRequest) { XMLHttpRequest.setRequestHeader(“Accept”, “application/json”); },
        success: function (data, textStatus, XmlHttpRequest) {
            ProcessReturnedEntity(data.d.results);
           
        },
        error: function (xmlHttpRequest, textStatus, errorThrown) {
            alert(“Status: ” + textStatus + “; ErrorThrown: ” + errorThrown);
        }
    });
    function ProcessReturnedEntity(OneEntity) {
  
        for (var i = 0; i <= 100000; i++) {
            var oneEntity = OneEntity[i];
            names = oneEntity.new_name;
       //   alert(names);
            if (name == names) {
                var code = oneEntity.new_EmployeeCode;
                Xrm.Page.getAttribute(“new_employeecode”).setValue(code);
              //  alert(names);
            }
        }

    }

}

SOURCE : JUST2CODE.IN
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012 

The post ODATA : get and set value from one entity to another (On change of look up) USING ODATA JAVASCRIPT IN MSCRM 2011 , 2013 appeared first on Microsoft Dynamics 365 Blog.

]]>
2852