ChangeComany Function doesn't support Validate function?

Shonatina
Member Posts: 114
Hi Experts,
I would like to know why the validate function isn't supported in the changecompany function and what can be used instead of validate function.
Thanks.
I would like to know why the validate function isn't supported in the changecompany function and what can be used instead of validate function.
Thanks.
smile always
shona
That which you seek inside is that which you find outside
shona
That which you seek inside is that which you find outside
0
Comments
-
Hi Shonatina,
... because it was designed this way.The root node of the context is company, representing approx. the same as a company code in SAP (for instance). Transactions outside a company are possible, but more like an afterthought than by design. The context of your transactions (and for all variables within) is set by opening up a session in the specified company. Therefore, all validates and views are in this context. When you do a changecompany() on a table, the context for the TableData object changes, but not for the variables inside the record - meaning all validates work, but refer to the original session context.
In NAV2013 you can start separate background sessions with an entry point (codeunit) and a context (company). I think it will be a big improvement for cross-company transactions, but wouldn't solve the functionality problem many actual NAV users have. They have grown over time and are larger structures now, with several companies (split for legal or technical reasons). This brings master data management issues, and intercompany transactions.
HTH.
with best regards
Jens0 -
You basically have to take the code within the OnValidate function into what ever code you have written and mirror that code with whatever variables you need and call the CHANGECOMPANY on all those record variables as well.
I have been frustrated by this for years and am looking forward to 2013, for at least some ability to do this.Gerry Kistler
KCP Consultores0 -
The change in 2013 isn't in CHANGECOMPANY, but you can actually program C/AL to start a new session in another company, which is actually much better. You can just spin off another session and tell that session what to do, and you can continue on in your own session, very powerful stuff. Might be a good idea for a blog0
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