How should I interface a website with a NAV server?

andyfandyf Member Posts: 11
Hi,

I work for a web development company, and we've been approached by a client who want, among other things, to have their website display various queries on their customer data (eg. show me everyone within fifty miles, everyone under category X, etc.) which is stored in Microsoft Dynamics NAV. It would be good to have read/write access to records, but it's not a deal-breaker to have only read. I was hoping folk would recommend a way to communicate with the server. I'm happy accessing the DB directly; it would be nice if there was an API dedicated to this; any other ideas?

We haven't yet produced a proposal for this client, so I'm looking for an idea of available methods and their complexity. I've done a couple of searches and found very little; if this area's been covered already, please feel free to throw some links and say, 'go read!'

Many thanks in advance,

Andy

Comments

  • SavatageSavatage Member Posts: 7,142
    Which version of Nav do they have?
  • andyfandyf Member Posts: 11
    I don't know; I'll find out. Out of interest, does it make much of a difference?
  • kinekine Member Posts: 12,562
    Yes, and I recommend to get in touch with their NAV partner. They will tell you what you can do. In most cases you will need some changes in NAV to have everything you need and the partner is responsible for the solution. E.g. you cannot just read the data as you wish from the DB, because possible performance issues etc. which must be foreseen and somehow solved. You can e.g. replicate needed data into some separate database on different server when the data should be intensively accessed from outside etc.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • andyfandyf Member Posts: 11
    Just waiting for the version number now.

    @kine Forgive my ignorance, but is it necessarily the case that they will have a NAV partner? I'm afraid I am really new to NAV. And regarding the replicating idea, how would you foresee managing changes from the website propagating to the NAV db? Maybe we could access the db directly for writes (as they would be relatively rare) and use the replicated db for reads? Are you confident that it's a bad idea to read the db directly? (Allowing that it would need to be load-tested and potentially moved to a more powerful server.)

    Thanks all for your time, very much appreciated,
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Yes, it's always a bad idea when an external program is going directly into your ERP database. Problem not just on the technical level, but also security risks as well.

    What kine suggested is the way to go about it. Instead of having programs access your ERP database directly, dump the necessary data into a separate SQL express database for the website to do query on.
  • andyfandyf Member Posts: 11
    Apparently they're running version 5 with MS SQL 2000, with plans to upgrade to Navision 6 with MS SQL 2008.

    @Alex Many thanks.
  • andyfandyf Member Posts: 11
    So if I use the separate database how would you recommend propagating changes initiated from the web to the actual NAV db? (Eg. when a user of the website wants to update their address.)
  • gvolkovgvolkov Member Posts: 196
    If they will be on version 6 (2009) you can use web services. otherwise you can use NAS. Do not write to database directly, you will definitely cause some damage doing that.
    How you do it is just going to depend on what exactly they expect out of this 'integration'.
    You can generate files in your web app and then use dataports for flat text imports, XMLPorts for structured files, and then setup automated processes in NAV to run those and process the information contained in those files. For that you will need someone who knows NAV to write code to handle this data you output. This is the easiest way.
    Microsoft Certified Technology Specialist
    Microsoft Certified Business Management Solutions Professional
    Microsoft Certified Business Management Solutions Specialist

    http://www.navisiontech.com
  • kinekine Member Posts: 12,562
    If they are upgrading, they have NAV partner... If they were on NAV 5.00 on SQL 2000, the partner is not so good... I do not know their relations with the partner, but you must be sure if there is some or not. In most cases the partner have the responsibility for the system, and connecting to it without him is not good. The replication is for reading, which is in most cases the biggest part of the integration. Another thing are prices, which are not easy to calculate just from the base data, I recommend to do some webservice for them. Writing into NAV is best through webservices too, in most cases it is just about creating order or something like that.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • andyfandyf Member Posts: 11
    Thanks for the help everyone, very useful.

    @gvolkov, kine - Thanks, I didn't know there was a web services API.

    I take it from gvolkov's comment that the web services API was only added in v6; I don't think I can assume they will be running that version.
    otherwise you can use NAS
    So a bit of googling tells me that NAS is the application server, ie the middle tier. Could anyone point me at some docs on how to remotely interface with it?
  • andyfandyf Member Posts: 11
    @gvolkov I just re-read your reply. You're suggesting using an automated import from file on the NAV side: does this mean there is no real API I can use with v5?
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    andyf wrote:
    So a bit of googling tells me that NAS is the application server, ie the middle tier. Could anyone point me at some docs on how to remotely interface with it?
    The NAV ProductDVD contains a document w1w1atas.pdf in the \Doc folder, which describes how to install the NAS. You'll need to write your code in NAV though, it's not that the NAS provides you with an API. And this customization is not a task for you if you are new to NAV. It's not modifying an Access-db application you know. You should contact your NAV partner to do the customization for you.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • andyfandyf Member Posts: 11
    You'll need to write your code in NAV though, it's not that the NAS provides you with an API
    Thanks, that's what I needed to know.
    this customization is not a task for you if you are new to NAV.
    I wouldn't be implementing anything on the NAV side, only on the web side. I just wanted to understand what the best way to interface would be. We haven't agreed the deliverables yet and I'm just scoping out this area.

    Thanks
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    I think the best way to put data into NAV, would be to populate some new tables directly from your web application. Then you would have the NAS, which reads these new tables from time to time, and move the contents to the final NAV tables. That way, the NAS can execute all business logic, as the code would run inside NAV.

    Another way would be to do a technical upgrade to NAV 2009 SP1 (so you are only updating the technical NAV environment, not the NAV application). Then you can use the Webservices functionality, directly from your web application, to put your data into NAV.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • andyfandyf Member Posts: 11
    Thanks for the ideas! I definitely prefer the idea of using web services to anything else...
    do a technical upgrade to NAV 2009 SP1 (so you are only updating the technical NAV environment, not the NAV application)
    Is that free/cheaper then? Given that the client is already planning to upgrade to v6, I'm not sure pushing them to make an early change will be an easy sell. My current thinking is to offer a read-only service based on exported data at the start, and then implement a 'proper' integration using the web services api when they make the upgrade.

    Thanks again for the help, it's been invaluable to a complete NAV noob like myself:)
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Search this forum for "technical upgrade", search.php?keywords=technical+upgrade&terms=all&author=&sc=1&sf=titleonly&sk=t&sd=d&sr=topics&st=0&ch=300&t=0&submit=Search+the+forum , and you find some topics.

    Welcome to the NAV world, and to this on-line community.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • andyfandyf Member Posts: 11
    Thanks again, I'll look into it.
  • gvolkovgvolkov Member Posts: 196
    I think without knowing the situation and requirements its really tough to tell what would be best. There are several ways to accomplish this though. Work closely with your NAV specialist and make a decision that's best for your client.
    Microsoft Certified Technology Specialist
    Microsoft Certified Business Management Solutions Professional
    Microsoft Certified Business Management Solutions Specialist

    http://www.navisiontech.com
Sign In or Register to comment.