Calling the External WCF Service From Java Script In CRM 2013

Summary: Calling the External WCF Service From Java Script In CRM 2013


function WCFServiceCalling(oppid, oppname,fileNames) {
    var Opportunity = new Object();
    Opportunity.OpportunityID = oppID;
    Opportunity.OpportunityName = oppName;
    $.ajax(
        {
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "http://ServerName/ORBDocService.svc/MethodName",
        async: false,
        data: '{"opportunity":' + JSON.stringify(Opportunity) + ',' + '"fileNames":' + JSON.stringify(fileNames) + '}',
        dataType: "json",
        success: function (response) {
        if (response != null && response != 'undefined') {
            flag = response;
            return response;
        }
    },
    error: function (a {
        alert("An error occured");
    }
});
}

Popular Posts