Hi,
I am currently working on an integration project and it requires synchronization of data between a NAV table and a schematically similar external table. I would like to perform a full sychronization between both tables periodically, which requires some sort of timestamp comparison. NAV tables have a timestamp field. Does anyone know a clean and elegant way to access the value in the timestamp field using only C/AL?
Thanks
Scott
0
Comments
If you are working on a Navision-DB => Navision doesn't have such a field.
If you are working on SQL, you best work directly on SQL. Navision C/AL has no access to it. And on SQL it will be a lot faster.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Hi Kriki,
If there is no direct access to this field from C/AL. Are you suggesting ADO would be the only strategy to access the timestamp field?
Scott
Be careful with replication and Navision-DB's. The problem is that that field is used by Replication to know what is new and by Navision for simulating the versioning-principle.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Actually the two tables are not in the same database, though they are schematically so similar and have many common fields. What I'm trying to do here is to sync selected tables between NAV and RMS (e.g., Item and Customer). [Perhaps later we can move this discussion to the RMS-NAV integration topic]. I want to hear more from technical experts in this forum first so I get my head around the techniques use to sync tables. Next I will I have to determine the direction of dataflow between tables.
Next questions:
Will users update the table in only 1 database? Which one?
What frequency of updating (to the other database) is required?
Hi bbrown, may I ask why timestamp should not be used when synchronizing records? I am thinking more along the line of synchronizing individual tables rather than database files.
My understanding of synchronization is this. Your goal is to ensure currency of records across different databases.
Let SourceTableRecCount be S and TargetTableRecCount be T, you can use the following technique to detect table-level or record-level change.
S > T: Row count to detect addition of record
S < T: Row count to detect deletion of record
S = T: May suggest no change or field change. Only way to tell is from timestamp
Timestamp becomes important when you try to ensure currency of a record. For example, if a customer changed his phone number or mailing address and you have the same customer (same VAT Registration No. or Tax File No.) in the Customer table in both databases. How would you determine which one is current without looking at the timestamp?
In NAV, we are lucky that Customer and Item tables both have a Last Date Modified field. But what about other NAV tables that don't like Sales Price?
If you're trying to sync two tables that have the exact same table structure, there are other specific questions we also need to answer:
1. What strategy do you use to detect change?
2. If change is detected, how do we sync the source and target tables?
3. Which one is the master table? Which one is replicate? Can either one be the master?
No, user can make changes to the records in either database. In my case a user can update a Customer record in a NAV Customer table at head office and or in RMS Customer table at the store.
Can't tell you for sure right now. We want this to be a user option in a Setup table: Every X Minutes, Every Y Hours, etc. However I guess the real design decision here is whether we want to sync it real-time (triggered by OnInsert(), OnModify() or OnDelete()) or not (i.e., asynchronous batch update).
A user updates table in DB-1. Between that time and the time the sync process runs, a user updates the same record in DB-2.
Scott
The issue is DB-2
If you make Navision the master database and have changelog turned on for any tables in question you could look to pull data from that to determin what changed and when.
Epimatic Corp.
http://www.epimatic.com
Agreed - this is what we did in MASI Retail Portal(TM).
http://www.masi.com/markets/MASIRetailPortal.html
_________________
Paul Berberich
MicroAccounting Systems, Inc.
Bellevue, WA, USA