Exchange data between company

Fiammenghi
Member Posts: 17
Hi to all,
I've a native database (Navision 4.00) with 2 company.
Is there a method to read contents of some tables of the other company ?
If so how ?
I know there is a properties of a table (data per company) that if set to no let me share the table, but this is not what I want.
Using code, I'd like to read some records of tables of the other company.
Many tahnks in advance
Fabrizio Fiammenghi
I've a native database (Navision 4.00) with 2 company.
Is there a method to read contents of some tables of the other company ?
If so how ?
I know there is a properties of a table (data per company) that if set to no let me share the table, but this is not what I want.
Using code, I'd like to read some records of tables of the other company.
Many tahnks in advance
Fabrizio Fiammenghi
0
Comments
-
recYourTable.CHANGECOMPANY("The company You Want");
Be carefull NOT to use triggers of the table when putting data in it.
This because if in the triggers another record is read or written, that record will be in CURRENT company!Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Are they going to fix this in Navision 5?0
-
-
Well it's screwed up design if you ask me.
Ofcourse, your next smart answer would be, "Nobody will ask you. So don't worry"0 -
In my opinion it is too complicated to have something like "context" for each record to know in which company you are in context of the original record...
Think about it. If you want to have possibility to call C/AL from another company through some recrod, it means, that all actions called from this record must have own context in which they run (context of the second company). But it is not possible, because part of this context is for example singleinstance codeunit initialized when opening company. But because in this situation you have not opened the company, you have not correct context in which the C/AL code for the second company can run. It is not possible to provide correct context for such a code...0 -
ara3n wrote:Well it's screwed up design if you ask me.
Ofcourse, your next smart answer would be, "Nobody will ask you. So don't worry"
The big green smiley face at the end of my comment should clue you in that I was joking.0 -
Yes, but inheriting the variables is not enough to have consistent context (think for example about some SingleInstance CU, which is activated on login and you need some values from there to validate some field...).0
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