Changecompany

Cristina
Member Posts: 35
I have a txt file which contains informartion for 2 companies from Navision and I want to imported in one step in both companies (each with his own values) using Validate trriger.
How can I do it? (I've with table.CHANGECOMPANY but when Validate trriger is calles the correlated tables remains on work company)
Cristina
How can I do it? (I've with table.CHANGECOMPANY but when Validate trriger is calles the correlated tables remains on work company)
Cristina
0
Comments
-
Hi Cristina,
that's not possible.
But perhaps helps this idea:
in the import code check if the information is for the actual company, then insert it else skip the information.
run the import in both companies
br
Josef Metzbr
Josef Metz0 -
I heard Navision 4.0 has a intercompany feature and perhaps can be modified to fit your needs.
But then again, it won't be released until Fall...Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Well it is possible, but it gets complicated quickly.
When you do a CHANGECOMPANY, you change the company ONLY on the record variable that you call it from. So if you change the company of your record variable and then you validate a field, and in this field there are other record variables, you will run into problems. These other record variables are reading/writing into the current company, because you did not change the company.
The solution is either the previous suggestion (only running the values for the current company, but do this for each company) or...
You can set values without field validation, and if you really need field validation, you copy the code from the field validation into your code, makin sure that you change the company for each record type variable.
hth0
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