1

I have a project where I need to pull data from an NAV server, I found only this https://www.cdata.com/drivers/dynamicsnav/python/ for reference. I also somewhere this snippet but was unable to use it.

import pandas
import matplotlib.pyplot as plt
from sqlalchemy import create_engine

engine = create_engine("dynamicsnav:///?http://myserver:7048&User=myserver\Administrator&
Password=admin&ServerInstance=DYNAMICSNAV71")
df = pandas.read_sql("SELECT Name, Prices_Including_VAT FROM Customer WHERE Name = 'Bob'", engine)
df.plot(kind="bar", x="Name", y="Prices_Including_VAT")
plt.show()

Is there a way to connect to NAV using Python? If this doesn't work I'm planning on using a bot but the data is quite big and it will take several hours if not days. Thankyou.

(This is my first question so please forgive me for any nonprofessional behaviour.)

Arush
  • 11
  • 3
  • Are you looking for out of the box solution for python our you want to know what are the ways to connect to nav? Because I'm afraid there is no out of the box solution. And depending on the version of nav you are targeting it might be tricky to connect. – Mak Sim Sep 08 '21 at 13:12
  • -> 2013 version of NAV – Arush Sep 08 '21 at 13:16
  • -> I'm looking for anything that works – Arush Sep 08 '21 at 13:17
  • If it's 2013, then unless someone has published web services explicitly you can't access Nav through http(s). If someone has published then you should contact him to get the address and the name of the services. – Mak Sim Sep 09 '21 at 11:40
  • After you get the address it is just soap protocol. – Mak Sim Sep 09 '21 at 11:40
  • Please check this screenshot; https://drive.google.com/file/d/1Sz4OoixNsAZEkiuISalgtk5MW7jTHhtH/view?usp=sharing – Arush Sep 09 '21 at 12:11
  • The issue is that this NAV is controlled by a different unit and it will take at least a month for them to process any request that I make. That is why I am looking for an alternative – Arush Sep 09 '21 at 12:12
  • You do realize that random people on the internet can't solve problems of inner-unit interaction of your company? Anyway, on the screenshot the tick `published` must be set. In this case nav will listen on the endpoint. The endpoint address will be shown in the next field. After this you can fetch wsdl from that URL and make requests against it. – Mak Sim Sep 09 '21 at 18:36
  • Here some docs https://learn.microsoft.com/en-us/dynamics-nav/how-to--publish-a-web-service – Mak Sim Sep 09 '21 at 18:38
  • I am just a freelancer working with a consulting company and don't actually work here. Thank you for the reference, I followed the guide and was able to publish a web service but I don't know how to get the URL. Can you help me with that? I am attaching a screenshot for the service I published. https://drive.google.com/file/d/1v7oiBsg61yrZWXPI92eqtfo592s7DIMO/view?usp=sharing – Arush Sep 10 '21 at 10:07
  • You need to make the URL field visible on this page. The interface looks unfamiliar to me though, so I'm afraid i can't tell exactly how to do it. Or try ctrl+alt+f1 to show all the field on The page. – Mak Sim Sep 10 '21 at 15:24
  • https://learn.microsoft.com/en-us/dynamics-nav-app/ui-personalization-windows-client try this article – Mak Sim Sep 10 '21 at 15:25
  • Those didn't help, I only have client's access not the administrator's access. I can search for pages if there's a page where I can get the URL from. – Arush Sep 12 '21 at 05:55
  • You can try to construct url yourself if you know the host name, instance name and so on. https://learn.microsoft.com/en-us/dynamics-nav/soap-web-service-uris – Mak Sim Sep 12 '21 at 14:51
  • Or if you up to odata https://learn.microsoft.com/en-us/dynamics-nav/odata-web-services – Mak Sim Sep 12 '21 at 15:09
  • If the URL I have looks like this http://121.184.86.83:8080/DynamicsNAV60Company/WebClient/List.aspx (The numbers have been changed for privacy), the published web service is of object type 'Page' with 36 as object id and NAVsynchBOM as Service name. Could you tell me what the URI https://://OData would look like. I tried a few combinations but with no luck. Thankyou for your support :) – Arush Sep 14 '21 at 09:47
  • Nope. There is no way to guess port and instance name of OData endpoint from web client's url. Web client's url might be a public and completely different. – Mak Sim Sep 14 '21 at 09:59
  • I understand. Thank you again for helping. I have discussed the matter with that other unit, it will take them a few days to act. – Arush Sep 15 '21 at 08:53

0 Answers0