1

I am researching how to integrate Microsoft Dynamics NAV with my existing REST API (built on Django REST Framework). What I would like to do is trigger API calls from NAV to CRUD objects via the REST API.

Reading the web services docs for NAV, it seems clear that NAV can expose a web service for other software to consume from. But can NAV consume 3rd party APIs? In the web services examples documentation, it says:

Solutions that need to execute business logic or read data from Microsoft Dynamics NAV are candidates for Web service implementation. These can also be solutions that write data to Microsoft Dynamics NAV and validate the data using existing business logic.

Also, it gives the following example of how to use web services:

Execute any kind of business logic that is more easily developed and managed in Microsoft Dynamics NAV.

However, I don't see any examples of data writing. It doesn't seem that in the exposure of web service pages or codeunits, there's a way to make calls to 3rd party APIs and execute business logic with the data that comes back within NAV. Is this actually possible?

John Slegers
  • 45,213
  • 22
  • 199
  • 169
Neil
  • 7,042
  • 9
  • 43
  • 78
  • If you don't receive an answer try [Mibuso.com](https://www.google.es/search?q=Calling+an+external+API+from+Microsoft+Dynamics+Nav+site%3Amibuso.com&oq=Calling+an+external+API+from+Microsoft+Dynamics+Nav+site%3Amibuso.com&aqs=chrome..69i57.454j0j9&sourceid=chrome&es_sm=122&ie=UTF-8) – ian_scho Mar 17 '15 at 08:12
  • Or http://dynamicsuser.net is a worthy shout also. – SeeSharp Mar 17 '15 at 13:58

2 Answers2

2

Unfortunately not, no.

You do however have access to the full .NET framework from within the 'Development Client' of Dynamics NAV - When defining your variables select the Type of DotNet

It's far from perfect, so for larger tasks I'll create AddIns or completely external libraries (depending on version).

For something smaller like this I personally find it easiest to write it in C# as a small (console) app and the 'translate' it back into Dynamics NAV.

SeeSharp
  • 2,760
  • 16
  • 15
0

If you are looking for way to invoke a web service then why do you need Nav web services? Nav web services is a way to call Nav.

These can also be solutions that write data to Microsoft Dynamics NAV and validate the data using existing business logic.

This means if you invoke published Nav web service then you can pass data to your call and the data will be validated and saved to Nav. So this is about how to push data to Nav, not pull from external system.

If you want to invoke a web service from Nav consider this options:

  1. Write external wraper library (as mentioned by @SeeSharp or as described). Then use it in C/AL as DotNet or Automation types of variables.
  2. Use existing libraries like 'Microsoft XML, v6.0'.XMLHTTP60 right in C/AL to make http calls to your web service.
  3. Do it Navision style.
  4. Last damn option is to write console application that will consume your web service and call it from Nav using shell. This is not an option, I know.
Mak Sim
  • 2,148
  • 19
  • 30