Is this a bug?? Insert data in another company - the change log settings from the source company ???

edoderoo
Member Posts: 89
We have a company that gets a refresh of all customers, suppliers, items and a few other base files. Therefor we do not need to track any changes in the change log in the destination company, and they *are* switched off in the change log settings. Nevertheless we get a full set of log-entries, and I get the feeling this is due to the settings in the source company, where we do want to track changes. NAV is looking at the wrong settings when
Is this a known bug in NAV2017 when using Record.CHANGECOMPANY()?
A work-around might be to start the daily copy codeunit from the destination company, and use Record.CHANGECOMPANY('source company') to retrieve the records, but for now I'm just amazed that this is necessary.
Is this a known bug in NAV2017 when using Record.CHANGECOMPANY()?
A work-around might be to start the daily copy codeunit from the destination company, and use Record.CHANGECOMPANY('source company') to retrieve the records, but for now I'm just amazed that this is necessary.
IF User.Loves('Edo') THEN ok() ELSE currReport.genSkip;
0
Best Answer
-
When using CHANGECOMPANY on a record variable, only that instance of the table is referring to the new company. ALL code (including VALIDATE and INSERT/MODIFY/DELETE/RENAME triggers in the record that was changed!!!) is executed in the 'old' company, and all records that are read/modified through the code are also read from the Original company.
So, for instance, if you do an INSERT into a table that is changed to a different company, and the code in the INSERT trigger tries to find the last available record in order to set a new entry. no. , the insert code reads the last available record in the current company, NOT in the 'changed' company !Jan Veenendaal5
Answers
-
When using CHANGECOMPANY on a record variable, only that instance of the table is referring to the new company. ALL code (including VALIDATE and INSERT/MODIFY/DELETE/RENAME triggers in the record that was changed!!!) is executed in the 'old' company, and all records that are read/modified through the code are also read from the Original company.
So, for instance, if you do an INSERT into a table that is changed to a different company, and the code in the INSERT trigger tries to find the last available record in order to set a new entry. no. , the insert code reads the last available record in the current company, NOT in the 'changed' company !Jan Veenendaal5
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