locked
CRM 2013 + WC Services RRS feed

  • Question

  • Hi,

    In CRM 2013 contact entity am having one attribute call it as  Scoring.. once i eneter the data  click ribbon button it hast to pass the wcf services and get the  offer details like  offer type, offer value etc.. i have to save same information in crm subgrid

    can you please send me the example of this... it's bit urgent


    Rammohan

    Friday, September 19, 2014 4:48 AM

All replies

  • you can write a soap request to invoke your wcf service..Make sure you have the same input parameters.

    The sample is as below

    if (DFAccountId == null) {


                    var data =
             '<?xml version="1.0" encoding="utf-8"?>' +
             '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">' +
             '<soap:Body>' +

             '<CreateCorporateAccount xmlns="http://tempuri.org/">' +
             '<BizAccountGuidId>' + Id + '</BizAccountGuidId>' +
                     '<businessName>' + CorporateBusinessName + '</businessName>' +
                     '<paidUpCapital>' + CorporatePaidupcapital + '</paidUpCapital>' +
                     '<yearOfFounding>' + CorporateYearoffounding + '</yearOfFounding>' +
                     '<industry>' + CorporateIndustry + '</industry>' +
                     '<corporateEmail>' + corporateEmail + '</corporateEmail>' +
                     '<corporatePhone>' + CorporateContactNo + '</corporatePhone>' +
                     '<streetAddress>' + streetaddr + '</streetAddress>' +
                     '<zipcode>' + zip + '</zipcode>' +
                     '<city>' + city + '</city>' +
                     '<indvState>' + state + '</indvState>' +
             '</CreateCorporateAccount>' +
             '</soap:Body>' +
             '</soap:Envelope>';

                    var xmlhttp = new ActiveXObject("Msxml2.xmlhttp");
                    xmlhttp.open("POST", "http://serdcrmsvr:2013/AccountService.svc", true);
                    xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
                    xmlhttp.setRequestHeader("SOAPAction", "http://tempuri.org/IAccountService/CreateCorporateAccount");
                    xmlhttp.onreadystatechange = function () {
                        ParseResult(xmlhttp);
                    };
                    xmlhttp.send(data);
                }


            }
    }

    Sunday, September 21, 2014 6:05 AM
  • Hi Raui,

    Thanks for your information, I am very knew this WCF Stub-hosting to get the information through the soap. can you send me the examples with bit more clear about it.

    in contact or lead entity needs to pass values to Third party application based on creteria need to access the values form the site.

    -Regards

    Ram


    Rammohan

    Monday, September 22, 2014 3:57 AM
  • If your requirement is to invoke a wcf service from client side then write a soap request with the same input parameters of the wcf service.

    Please provide more details of your requirement and post your wcf code here.

    Monday, September 22, 2014 5:34 AM