locked
How do I find a single record so I can then associate it with another record? RRS feed

  • Question

  • I have the following custom entities which has these attributes (truncated to only display the relevant attributes).

    -----------------------------------

    contactrelationship entity

    • contactid (datatype is of the built-in contact entity)
    • relationshipid (datatype is of custom relationship entity)
    • organizationid (datatype is of built-in account entity)

    relationship entity (works like a list of values. like values for populating a dropdown list. nothing special)

    • relationshipid (guid datatype which is the primary key)
    • description (sample values would be "staff" or "customer" or "visitor" and etc)

    --------------------------------

    What I want is:

    • to get a single "staff" record in the relationship entity (something like select * from relationship where description like 'staff%')
    • to get a single record from the account entity (something like select * from account where name like '%Transport%')
    • to get all the record from the contact entity (I am using RetrieveMultiple function for this)
    • and then save a new entry in the contactrelationship entity.

    I know there's a Retrieve function in CrmService but I don't think it can do what I want (see sample SQL above).

    Can you please help? Thanks very much in advance. :)

    ps. I'm new to Microsoft Dynamics so my terminology may be incorrect. I am trying though! :)

    Wednesday, June 18, 2014 3:25 AM

Answers