locked
How to retrive related entities of Account RRS feed

  • Question

  • Hello All,

    I want to retrieve related entities of Account plugin using sdk in MS CRM 4.0.

    Can any one help me on this.

    Thanks

    Kumar R

    Wednesday, January 18, 2012 12:58 PM

Answers

  • Thanks a lot Fiax...

    • Marked as answer by R.A.Kumar Wednesday, January 18, 2012 3:07 PM
    Wednesday, January 18, 2012 3:07 PM

All replies

    • Proposed as answer by Faisal Fiaz Wednesday, January 18, 2012 4:52 PM
    Wednesday, January 18, 2012 1:07 PM
  • Thanks a lot Fiax...

    • Marked as answer by R.A.Kumar Wednesday, January 18, 2012 3:07 PM
    Wednesday, January 18, 2012 3:07 PM
  • Hi Kumar

     you need to use the Reterive request of Crm Service

    Here is an example 

    [C#]
    // Set up the CRM Service.
    CrmAuthenticationToken token = new CrmAuthenticationToken();
    // You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
    token.AuthenticationType = 0; 
    token.OrganizationName = "AdventureWorksCycle";
     
    CrmService service = new CrmService();
    service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
    service.CrmAuthenticationTokenValue = token;
    service.Credentials = System.Net.CredentialCache.DefaultCredentials;
    
    // Create the column set object that indicates the properties to be retrieved.
    ColumnSet cols = new ColumnSet();
    
    // Set the properties of the column set.
    cols.Attributes = new string [] {"fullname"};
    
    // contactGuid is the GUID of the record being retrieved.
    Guid contactGuid = new Guid("4D507FFE-ED25-447B-80DE-00AE3EB18B84");
    
    // Retrieve the contact.
    // The EntityName indicates the EntityType of the object being retrieved.
    contact contact = (contact)service.Retrieve(EntityName.contact.ToString(), contactGuid, cols);
    
    

    hth

    dkay

    If the problem is resolved, we would appreciate a post explaining the resolution and mark the post answered and close the thread.

    Wednesday, January 18, 2012 3:10 PM