Replicate Data to second database on event

nofear87nofear87 Member Posts: 7
edited 2016-01-27 in NAV Three Tier
Hello my name is Robert and I'am new to Nav.
I have installed NAV Testversion. Now I plan to write a Script which replicates filtered data (for example only the articles) on a special event (for example a new article is created) to a second database in ms sql server. is this possible? Where I should start searching for information which help me to solve this problem?

Thanks!

Robert

Answers

  • yukonyukon Member Posts: 361
    Hi Robert,

    Welcome from Mibuso. I guess you are trying to transfer the data between Two Navision database. If yes, you can use WS for your requirement if you are using 2009 and above. You can use ADO .net if you want to transfer from your Navision database to other database (Not navision database).

    Here is WS documentation https://msdn.microsoft.com/en-us/library/dd355398.aspx

    Regards,
    Yukon
    Make Simple & Easy
  • nofear87nofear87 Member Posts: 7
    Hi Yukon.
    I have created a separate database in MS SQL (so it is not a nav database I want to sync/replicate?) How I get the business logic to replicate all items to the new database when a new item is created? Are there watchers or something and replicate services? Does ADO use the business logic?
  • JoergRJoergR Member Posts: 13
    edited 2016-01-27
    I've done such things in the past using 2 different approaches:

    -Small to medium no. of records: Let both Navision Systems talk together with help of Webservices. Advantage is, your business logic is already implemented and it is bidirectional. But it gets slow for larger replication data.

    - MS-SQL Replication: you can configure tables and even fields that get replicated into a temporary database which holds all records that are changed. This is because i dont want a external procedure to write into the NAV database. You then create a Codeunit in the Target NAV System which will connect to the temporary Database with ADO and checks for new entries (Timestamp). If you replicate multiple tables you can do it with recref and fieldrefs. Its very fast for large data, but you need to create the interface (codeunit) and pass the data to the target table (with validates for business logic). Also you need to implement an error handling routine / logfile for traceability.
  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'NAV Tips & Tricks' forum to 'NAV Three Tier' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • nofear87nofear87 Member Posts: 7
    thank you very much. i have only one nav system. the data should be written in a second database for another softwaretool. so the first way isn't practicable for me?

    The second way sounds interesting too me. But there is no business logic controlling my data? Its important to me, because I will write the temporary data back to nav.

    You would do this with ADO, too?
Sign In or Register to comment.