web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

3rd Party Web API

(0) ShareShare
ReportReport
Posted on by

Hi all hope your well

I'm after some guide or examples so i can try and build a plugin to do the following

On creation of an order (Order Button Click in quote) PostCreate on Order entity

I would like a plugin to get the information from the order entity and pass it to a Web API in xml format that then places that information within the API Order information field and then initiates the postorderdata in the API.

The API then generates a ordernumber which i would then like to bring back in to CRM into the order entity of the order it has just posted to the API and save it in a field 

Any guidance would be great i have a rough idea on what i need to do but a few examples of something similar from the order entity would help massively

Many Thanks

Dan 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Bas van de Sande Profile Picture
    4,383 on at

    Hi Dan,

    if I understand you correctly, you want another system to fill the order number in CRM?

    If that is the case, I would recommend that you create an asynchronous plugin that is registered on the create message of the order entity.

    In the plugin you have to use a FQDN (read URL) to connect to your external WebAPI.

    The reason I mention asynchronous is that you don't want that your users have to wait while the external system is being queried.

    On the other hand:

    have you ever considered to handle the autonumbering from within CRM? There are a couple of great solutions out there that you can use.

    I hope this helps you forward

    Bas

  • Community Member Profile Picture
    on at

    Hi Bas

    That is pretty much what I'm after sending the order information from CRM to the order system and get the order number back.

    I completely agree it would be nice to have CRM generate the order number but sadly this can't be the case

    Is the any chance you can point me in the right directions for some example code or guides.

    Many thanks

    Dan

  • Suggested answer
    Micchael Profile Picture
    390 on at

    Hi,

    The solutions I would recommend:

    Plugin based sync solution:
    http://celedonpartners.com/blog/celedon-autonumber-solution-for-dynamics-crm/  

    Work Flow based async solution:
    https://community.adxstudio.com/products/adxstudio-portals/releases/adxstudio-portals-7/download/ 
    Download the msi, install, AdxstudioProductivityPack solution located  %/Program Files(x86)/Adxstudio/Portals/Customizations/
    How to set up the Auto Numbering:
    https://community.adxstudio.com/products/adxstudio-productivity-features/documentation/adxstudio-auto-numbering-workflow-helper/

    There are two options of auto numbering  implementation: synchronously and asynchronously.
    Please consider:
    1. Async approach (with workflow or async plugin) cannot guaranty correct sequence due to async nature of execution.
    2. WF or async plugins will not work off-line. If your customer uses Outlook he might be notified that number will be created after synchronization with crm.
    3. Sync solution can break the sequence in case of off-line use. Outlook Client and mobile client work with db snapshot and will update the "indexer" entity out of main stream. Per each Outlook user. Then, after synchronization, you'll get many duplicated numbers.

    If you want to create your own the concept  is:
    1. Create entity to roll the index (Indexer).
        Fields for target entity type, current number (for reporting), next number (for assign)
        You can add pre-fix and post-fix fields as well.
    2. Set up the indexer per entity-target with desirable suffixes.
    3. Add to target entity a field to keep the number.
    4. Register a sync plugin on pre-create of entity or real-time workflow.
    - get indexer instance by entity-target logical name
    - get next from indexer (check if there is no duplications in crm), set up the number field
    - roll the indexer next and current (update the indexer entity).

    These are main points. You may vary if necessary.

  • Community Member Profile Picture
    on at

    Hi Michael

    Thank you for that information looks like it could be very useful in the future. But sadly in this situation the number will have to come from the 3rd party order/accounts system.

    I was ideally after some guides/examples on building a plugin to send xml data to a web api and get the order number back

    Many thanks for your help

    Dan

  • Suggested answer
    Micchael Profile Picture
    390 on at

    Hi Dandare,

    "I was ideally after some guides / examples on building a plugin to send xml data to a web api and get the order number back"

    I'm a little bit confused.

    In crm, "plugin" means a piece of server code that you can plug in to crm pipeline messages.

    Web Api, in crm, it's an OData endpoint providing access to crm service for external (even non .net) applications.

    If you use plugins you do not need a Web Api for crm CRUD, query or other manipulations.

    As I understand you want call an external service to get a next number.

    If so then here is a couple of links how to achieve that:

    https://code.msdn.microsoft.com/How-to-call-External-WCF-42c4490d
    If you call from crm on-line (sandboxed) plugin then the best practice is here:

    https://msdn.microsoft.com/en-us/library/gg509030.aspx

      

    BTW, I would create an indexer entity any way.

    It will help you to survive with Outlook and mobile offline modes.

    This way 3rd party service can be called after synchronization with crm and manage sequence of  offline created instances.

  • Community Member Profile Picture
    on at

    Hi Michael

    That is part of my answer in getting the order number back. But i need to also send the order information to the account system. 

    The account system basically gives us a webpage that has a box for the xml data from CRM then a action to POSTORDER this then creates the order number to be brought back. From the looks of it i think i should now be able to get the order number back i could just do with a bit of guidance sending all the order information such as customer name delivery address and products that are on the order

    Regards

    Dan 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans