Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

CRM WebApi Client

Posted on by Microsoft Employee

Hi everybody.

I have some necessity to send entity-record to my rest-service from plugin (during it's execution)... but, I don't want to write difficult logic inside this plugin!

Well, I suggest, that plugins logic should only implement bussines logic for entity-records just inside CRM (like field-checks for some conditions, or fieling somefield from another records), as for other logic for some bussiness-task, that works outside CRM, I prefer to endure implementation to some web/winServices. And rightnow I want to implement logic for webService client for different services outside plugin. But i don't know, is it posible to retrieve entity-record during plugin execution...

I mean, for example, plugin, that works with onCreate message - during it's execution entity-record is not commited to CRM-DB. And i don't know, can or can't i retrieve this record frob CRMWebApi with OData. So can i do something like this:

  1. From plugin "onCreate" i call webService.
  2. This webService with OData retrieve record, that proccessed in plugin just rightnow.
  3. This record wolk through some logic implementation in this WebService... ETC

*This post is locked for comments

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: CRM WebApi Client

    Hi,

    You can get properties of the record which is in execution in your pre plugin, but you won't be able to get it's GUID which is generated once record is in CRM DB. And if you need some unique id you can use alternate keys msdn.microsoft.com/.../dn932139.aspx. Although technically you can also pass your own GUID with entity object, but this is not recommended blogs.msdn.microsoft.com/.../the-dangers-of-guid-newguid

    Hope it will help.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans