Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Send Data to Other DB

$
0
0
Hi, I have a problem on sending data to another DB from NAV 2016. I have been searching that creating a view on SQL would be a solution to me. And then i try to follow the instruction :

1. in NAV: create the table ABC in NAV as an ordinary NAV table. LinkedObject is "no". This will creates a SQL table in NAV DB. Save the table and close the table editor.
2. now start SQL Server Management Console
3. find the SQL table that belongs to ABC in [NAV DB] and create a table [Copy of ABC] with exactly the same definition(same table name, field name, data type) in [Other DB]. If you want your data stored per company you will need several tables in [Other DB]. Maybe you mangle the Company Name into the table name like NAV does.
It's a good idea to keep a copy of the script that you use to create the SQL table until you are sure that everything works fine.
4. Now delete in [NAV DB] the original SQL table in SQL Server Management Console.
5. in [NAV DB] create a VIEW into Other DB in which you select all fields of [Other DB].[Copy of ABC].
Important: the name of this view must be exactly the same as the name of the table that Navision created for your ABC table. This includes the Company Name formerly mangled into the table name if you want your data stored per company. You will Need one view per Company.

Query :
CREATE VIEW CRONUS International Ltd_$(table_name) AS
SELECT *
FROM [Other_DB].[dbo].[CRONUS International Ltd_$(table_name)]

Now you should have a SQL VIEW in [NAV DB] that behaves exactly like the SQL table that Navision had formerly created.

6. return to NAV designer and edit the Definition of ABC. Set LinkedObject to "yes". Save and there you are.
    On the step 6 I couldn't save the Table using Validation or Force synchronize Schema. But when I close designer and I open it again the changes been made. LinkedObject set to "Yes". I try to Run that Table and yes it worked. Data has been sent to Other DB. The question is when i try to Sync-NAVTenant or Save again that Object it's always giving an error. Can you help me? what i'm missing?
cd8ba0b44a15c10065fd-24461f39geklo4f4b25k.png
1e20b7336331d5789078af53.r23.cf1.rackcdn.com/vadysoft-mibuso.vanillaforums.com/editor/4k/h0j1sk6q1pzd.png
43m2deq1p1id.png

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>