Insert sales Header and Lines from sql database

baduganbadugan Posts: 6Member
edited 2018-09-18 in NAV Three Tier
Hi, I am a SQL developer and I am tasked with inserting Sales Header and Lines from a SQL database into Navision 2017. It's an in house database that records staff orders on a different server that then needs to be bought into Navision as Sales Header and Lines..

This custom database is written in c# .net

How do I go about this please? Is there any step by step guide that I could follow?

Any help would be appreciated.

Navision 2017 and SQL Server 2016

Harry

Answers

  • KTA8KTA8 Posts: 180Member
    The recommend way to insert data is through rapid start services. I don't think is there any guide to do it through SQL at least an official one.
  • AKAK Posts: 191Member
    Never do something like that. I mean it. It's bad.
    You'll bypass all of the business logic and may end up shredding those tables. The correct way to do it (if rapid start isn't an option) is writing to a buffer table and let NAV populate the desired tables itself via job queue reading that buffer table.
  • baduganbadugan Posts: 6Member
    Thanks for the replies. I understand it's not wise to write directly to NAV via SQL.. hence the question here. What about using web services.. is there some tutorial that I can learn from.. can't seem to find anything informative that I can follow.. using an exposed Sales Order Web Service (SOAP) and a c# .NET app to be able to create those sales orders. All the related data for Sales order is held in custom database.. how can I use SOAP to trigger inserting a NAV Sales Order with that data.. any idea or pointers will be appreciated.
  • baduganbadugan Posts: 6Member
    Alternatively, is there any tutorial that I could use for Rapid Start Services? If it is any different from Web services
  • AKAK Posts: 191Member
    If you enter "Nav 2017 web services" in google, you'll find this right at the top. And they would do the job also.
  • RockWithNAVRockWithNAV Posts: 730Member
    I wont say it would be a custom table but Sales Header and Line is something which is the core standard tables and you should never insertion from SQl Side.

    How will you calculate those fields which NAV automatically does on OnValidate??
    Many Business Process wont be executed if you do it from SQL!!
  • baduganbadugan Posts: 6Member
    Thanks for the comment @RockWithNAV .. hence my question here. I was really hoping for a tutorial on using SOAP services in NAV and how to insert an Order from a .NET app. I have customer details and order details.. just need to trigger an order creation using SOAP from another app.
  • RockWithNAVRockWithNAV Posts: 730Member
    @badugan

    Yes this will be the correct way of doing this. You will get many tutorials on this as how to expose NAV service and consume web Service.

    In your write the code in a Codeunit and expose it as web-service, check out the parameters as you will have to receive XmlPort as parameter where you have header and line information's!!
  • baduganbadugan Posts: 6Member
    @RockWithNAV thank you.. are you able to give me links to these tutorials please? I can't seem to find that I can really use.. I'm only at a beginner / intermediate level. Thank you
  • krikikriki Posts: 8,541Member, Moderator
    [Topic moved from 'Dynamics CRM' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
    NAV TechDays 2018: 22 & 23 November 2018, Antwerp (Belgium)
Sign In or Register to comment.