mibuso.com

Microsoft Business Solutions online community
It is currently Wed May 22, 2013 9:13 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: ChangeComany Function doesn't support Validate function?
PostPosted: Fri May 18, 2012 8:43 am 
Offline

Joined: Wed May 05, 2010 12:00 pm
Posts: 103
Country: India (in)
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.

_________________
smile always
shona
That which you seek inside is that which you find outside


Top
 Profile E-mail  
 
 Post subject: Re: ChangeComany Function doesn't support Validate function?
PostPosted: Fri May 18, 2012 10:50 am 
Offline

Joined: Sat May 12, 2007 9:19 am
Posts: 271
Location: Falkensee
Country: Germany (de)
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

Jens


Top
 Profile E-mail  
 
 Post subject: Re: ChangeComany Function doesn't support Validate function?
PostPosted: Sat May 19, 2012 9:12 pm 
Offline

Joined: Fri May 18, 2012 3:04 pm
Posts: 148
Location: Armenia, Quindio
Country: Colombia (co)
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 Consultores


Top
 Profile E-mail  
 
 Post subject: Re: ChangeComany Function doesn't support Validate function?
PostPosted: Sun May 20, 2012 5:40 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Thu Jan 02, 2003 6:37 pm
Posts: 7931
Location: Howell, MI
Country: United States (us)
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 blog :mrgreen:

_________________
Daniel Rimmelzwaan
MVP - Dynamics NAV


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot], wakestar and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: