locked
Accessing Contact Phone Number from Account RRS feed

  • Question

  • Hi

    I am using CRM 2011 on -premises and I am trying to retrieve primary contact's phone number from account in CASE entity.


    In case entity I would like to get the contact Name, and contact phone number of the person who is a primary contact of Account, I like this to populate when user selects account.

     

    Would be great if someone help me or direct me on this I am not a good programmer but could try my head around.

    Currently I can access the name of the account using below code but I dont know how I can get the parentcontactid and details using Jscript I preume I might need to use soap but dont know how.

     

    function getDetails(){

    var lookupItem = new Array();
     lookupItem = Xrm.Page.getAttribute("customerid").getValue();

     if (lookupItem[0] != null)

     {
      var name = lookupItem[0].name;
      var guid = lookupItem[0].id;
      var entType = lookupItem[0].entityType;

    alert(name);
    alert(guid);

    alert(entType);

    }

    }

     


    Fkhoja
    Tuesday, November 29, 2011 9:01 AM

Answers

  • Sorry, but this forum covers the Microsoft Certifications and Exams. Maybe you want to ask the question in a forum targeting the CRM?

    With kind regards,

    Konrad

    • Proposed as answer by Mr. Wharty Tuesday, November 29, 2011 11:53 PM
    • Marked as answer by Mr. Wharty Wednesday, February 15, 2012 11:50 PM
    Tuesday, November 29, 2011 10:46 AM
    Answerer