Linked object and SQL View

rocatis
Member Posts: 163
I'm trying to do some object linking (NAV 5.01, SQL 2005) and I'm not doing very well...
Setup:
1) SQL Server A has a table and a view belonging to another (non-NAV) application.
2) SQL Server B (which is running the NAV database) has a (non-NAV) view which references the view on Server A. This works (i.e. opening the view on Server A shows me the data on Server
.
The problem I'm facing is accessing the data from within NAV. I simply cannot figure out how to create a table that links to the view - and judging by the skimpy documentation I've been able to dig up it should be possible to do (it just doesn't say how...)
Anybody got a clue? Am I trying to do the impossible?
Setup:
1) SQL Server A has a table and a view belonging to another (non-NAV) application.
2) SQL Server B (which is running the NAV database) has a (non-NAV) view which references the view on Server A. This works (i.e. opening the view on Server A shows me the data on Server

The problem I'm facing is accessing the data from within NAV. I simply cannot figure out how to create a table that links to the view - and judging by the skimpy documentation I've been able to dig up it should be possible to do (it just doesn't say how...)
Anybody got a clue? Am I trying to do the impossible?
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup
Senior NAV Developer
Elbek & Vejrup
0
Comments
-
Do you get some error messages? Is the view for one company or for all compaies?
Mean:
for every company one view -> the view must have the name Companyname$Viewname
in NAV the "table" with Porperty LinkedObject YES must have DataPerCompany YES and the Name = ViewName
is the View for all companies the same, the Name of the View is without the Companyname$.
The NAV "Table" has the property DataPerCompany = No and LinkedObject.Do you make it right, it works too!0 -
Some issues to keep in mind:
1. The view must be in the same database as Navision.
2. The Navision table must have the same name as the view
3. In the table property you must have to set LinkObject to yes
4. Delete the Navision table from SQL Server if the table still exists
5. Set LinkedInTransaction to No if the view connects to a database outside the Navision database
As mentioned in my topic (viewtopic.php?f=23&t=30763&p=149755#p149755) I have to set the SQL Server permissions of the user to db_owner to have this all work but I want the minize the permissions as low as possible. This must be by setting the quest account but this doesn't work for me.0 -
It turned out to be a rookie mistake: I had only defined the View for the company in which I am going to use it. No can do. The View needs to be defined for each company.
Thanks for your help!Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0 -
no prob and welcomeDo you make it right, it works too!0
-
I couldn't resist 8) :
How to display an SQL Server View in Microsoft Dynamics NAV0 -
Waldo wrote:I couldn't resist 8) :
How to display an SQL Server View in Microsoft Dynamics NAV
I actually found your blog while googling, and it's very nice. However, it also fails to mention that you need to create the view for each company in the database :?Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0 -
There is a property for the table called. DataPerCompany. If you set it to no, NAV will not add the prefix of company Name, So you only need one view.0
-
rocatis wrote:Waldo wrote:I couldn't resist 8) :
How to display an SQL Server View in Microsoft Dynamics NAV
I actually found your blog while googling, and it's very nice. However, it also fails to mention that you need to create the view for each company in the database :?
Well, I did mention it shortly as "If you would like this view to work for each company, you have to create a separate view for each company".
anyway, when you're compiling in one company, it's only going to check if the view exists in that company. If you're USING the view in another company, it's obvious you have to foresee that seperate view as well... .0 -
Waldo wrote:rocatis wrote:Waldo wrote:I couldn't resist 8) :
How to display an SQL Server View in Microsoft Dynamics NAV
I actually found your blog while googling, and it's very nice. However, it also fails to mention that you need to create the view for each company in the database :?
Well, I did mention it shortly as "If you would like this view to work for each company, you have to create a separate view for each company".
Well, thing is, it's not an option, it's a requirement.Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions