Nav version 4.
I have to validate some field in customer table and forse to synchronyse it in web page customer table. If I place web customer field update code in validate trigger, when it is possible nav reject customer record update for some reason and data will mismatch. What is the correct way of such sync in older nav versions with forms?
Simply add modify in validate trigger to force write rec to db? Seems works, but I doubted this is correct way to do this kind of sync.
Not really sure what you’re trying to do here? When a user updates a field in the customer table, then it must update a field in a “web page customer” table? How are these two tables related?
My goal is simply maintain the same values in nav db and in outter mysql db in similar tables then change is made from nav.
Where is no any direct relations between these db.
So the real issue is that you need to synchronize a table in a different database, not even inside NAV?
Unless it’s a requirement that the two tables need to be in synch at all times, then I would create a batch job, which would run the synchronization task for you.
Yeah, this maybe a good way, ill think about it, thanks!
Yes, if you use the trigger directly on the table then your users would have to wait until you completed your synch, and if it failed then their customer update would also fail.
So a batch job (eventually based on a Last Modified Date&Time field) would do the job much better. Then have the job queue run it as often as you need it, to keep it up to date.
Another option would be to add a new field “Last Modified ON” (Datetime) in the customer table, updated onmodify and oninsert then create a SQL job to filter by date and pull the data as needed.