Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Create into Dynamics using the the API

Posted on by 15

I have been creating entities over the API into Dynamics. 

For e.g - 

Entity contact = new Entity("contact");
contact.Attributes.Add("fullname", "h api test");
contact.Attributes.Add("emailaddress1", "hh@devenv1.local");
contact.Attributes.Add("telephone1", "1");

Guid contactId = service.Create(contact);

I have also used retrieve and delete methods.

I have done this for account, incident and task entities.

I want to create more over the API and interact with more fields/forms, so I want to know what else can I do using service or something similar.

Any documentation for help.

Thanks
  • Hus44 Profile Picture
    Hus44 15 on at
    RE: Create into Dynamics using the the API

    Thanks Samira ,

    Yes I could use both of these methods.

    What would the Associate and Assignmethod look like ?

  • Suggested answer
    SamiraM Profile Picture
    SamiraM 571 on at
    RE: Create into Dynamics using the the API

    No associate is not for assigning records. Associate is used for specify the foreign key relations.

    1)for ex you have create a message record from a contact form. So basically the relationship exist between contact and messages. And now you want to associate the message record with some other custom entity then you do it via associate method of api.

    2) for assignment you use update or assignrequest method.

    regards 

    samira

  • Hus44 Profile Picture
    Hus44 15 on at
    RE: Create into Dynamics using the the API

    So Associate be used to assign a record to another user ?

    I just want to do general tests using the API so creating entities , interacting within Dynamics and doing assertions.

    So thats why I wanted to know what else I can do as all I have done so far is create and delete entities , which did have optionset and lookup fields.  

  • Suggested answer
    SamiraM Profile Picture
    SamiraM 571 on at
    RE: Create into Dynamics using the the API

    1) Update means to perform update operation on entity.

    2) Associate method is used to associate any record that participate in relationship.

    Any special requirement you are checking for?

    Regards

    Samira

  • Hus44 Profile Picture
    Hus44 15 on at
    RE: Create into Dynamics using the the API

    Hi Samira,

    Thanks for responding... I have actually done all of this but what did you mean by update and associate methods of api.

    Are there methods of adding items to a queue.. assigning records to different users ?

  • Suggested answer
    SamiraM Profile Picture
    SamiraM 571 on at
    RE: Create into Dynamics using the the API

    Hi,

    If you want explore more for api:

    1) Try creating OptionSet fields.

    2) Try Creating Lookup fields.

    3) Try to retrieve OptionSet label.

    4) Try working with currency field

    5) Try update and associate methods of api.

    6) Try to query CRM data using fetch XML

    Regards

    Samira

    Please mark it verified, if it answer your question.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans