locked
Get GUID of Contact Entity Record from an external JS Application RRS feed

  • Question

  • I am using Xrm.page library to open existing contact entity records. For this I need to pass GUID as a parameter:

    Xrm.Utility.openEntityForm("contact", GUID);

    I know the business phone number i.e. telephone1 of the record, so can I use that number to somehow extract the GUID of the corresponding record? Important thing is that I am writing and running this code outside the CRM, so I am not using web resources, I need some way of using Xrm.page which does not involve usage of web resources.

    Thursday, August 22, 2013 10:38 AM

All replies

  • Hi,

        If you are planning to use CRM SDK from external application, I would recommend using server side code as explained below:

    http://msdn.microsoft.com/en-us/library/gg695790.aspx

    Hope this helps.
     
    -----------------------------------------------------------------------
     Minal Dahiya
     
    If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    • Proposed as answer by Minal Dahiya Thursday, August 22, 2013 11:03 AM
    Thursday, August 22, 2013 11:02 AM
  • Thanx Minal, but is there any way of doing this via Xrm.page Library ?
    Thursday, August 22, 2013 1:25 PM
  • Hi Absaar,

    The Xrm.Page library cannot be used outside of a CRM context. What features of the Xrm.Page library do you need to use?


    Michael Palmer
    xRMPalmer     @MJFPalmer     Rockstar365

    Thursday, August 22, 2013 1:47 PM
  • Thanx Palmer, I need to get the records stored in contact entity, I am able to extract the information of first contact but I also need to extract info of other records, so I need to use Xrm.Page for that.

    More Specifically :

    var attributeList = Xrm.Page.data.entity.attributes.get(); for (var i = 0; i < Xrm.Page.data.entity.attributes.getLength() ; i++) {

    document.writeln(i + ". " + attributeList[i].getName()+ " = " + attributeList[i].getValue() + "<br/>");

    }

    I get the attribute name and the values of first record corresponding to the attributes.

    What I want to do is that I also want to get the values of next records of contact entities, how can I do that using Xrm.Page library. 

    Friday, August 23, 2013 7:43 AM
  • Hi Absaar,

    Ok, I see. The Xrm.Page library does not provide methods to get information from other entity instances. You will either have to go with server side code as mentioned above or use OData to retrieve information in JavaScript (http://msdn.microsoft.com/en-us/library/gg334279.aspx).


    Michael Palmer
    xRMPalmer     @MJFPalmer     Rockstar365

    Friday, August 23, 2013 10:19 AM