Calling Codeunit in Other company
ssingla
Member Posts: 2,973
Our Client is running on Navision 3.7 and have two companies. We are customizing intercompany functionality for them because there are huge intercompany transaction. Earlier we were customizing on lines of 4.0 functionality of inbox/outbox but now our client requires the posting of the same.
To explain:
If I post a transaction in Company A for payment made on behalf of Company B , then the creditor of the company B should be applied and balance entry in intercompany account should be created in Company B. In Company A, the bank account should be credited and Incompany Account should be debited.
My Techies are telling that posting routines are done by CodeUnits and it is not possible to call codeunit of company B from Company A.
Is it so.
Please Advice.
Thanks in Advance.
To explain:
If I post a transaction in Company A for payment made on behalf of Company B , then the creditor of the company B should be applied and balance entry in intercompany account should be created in Company B. In Company A, the bank account should be credited and Incompany Account should be debited.
My Techies are telling that posting routines are done by CodeUnits and it is not possible to call codeunit of company B from Company A.
Is it so.
Please Advice.
Thanks in Advance.
CA Sandeep Singla
http://ssdynamics.co.in
http://ssdynamics.co.in
0
Comments
-
ssingla wrote:Our Client is running on Navision 3.7 and have two companies. We are customizing intercompany functionality for them because there are huge intercompany transaction. Earlier we were customizing on lines of 4.0 functionality of inbox/outbox but now our client requires the posting of the same.
To explain:
If I post a transaction in Company A for payment made on behalf of Company B , then the creditor of the company B should be applied and balance entry in intercompany account should be created in Company B. In Company A, the bank account should be credited and Incompany Account should be debited.
My Techies are telling that posting routines are done by CodeUnits and it is not possible to call codeunit of company B from Company A.
Is it so.
Please Advice.
Thanks in Advance.
That is indeed the case.
What you can do is running 2 NAS processes (one in each company) that is posting these lines. From one company, you can fill a table (journal) which represents the postings that need to be done in that company. This is basically the logic that default intercompany uses with the inbox/outbox: Fill journal in other company, log into other company, execute journal lines.
Why using NAS? It makes it "automatically posted" for you. You have to program an insert into a journal, NAS picks it up and posts the line. For you, it seems that the journal was posted automagically when you post the payment.0 -
Making the 2 NAS and posting automaticly is a bad idea. You will have no control over error handling neither on creation of lines not on posting save for the bad NAS log. You should copy what intercompany is doing, and handle it manually like that(use sales codes as example). That will also mean you can handle dimension transfers etc. And yes it is more work, but it means your customers are responsible for data as it should be.0
-
Mbad wrote:Making the 2 NAS and posting automaticly is a bad idea. You will have no control over error handling neither on creation of lines not on posting save for the bad NAS log. You should copy what intercompany is doing, and handle it manually like that(use sales codes as example). That will also mean you can handle dimension transfers etc. And yes it is more work, but it means your customers are responsible for data as it should be.
On the contrary.
With NAS (and timer dll) you have better error handling then where else in NAV. OnTimerError you recieve the error message that was given by NAV while posting. You can write code that handles one record (from your posting table) at a time. You can handle errors with OnTimerError, write the error message to the line, so that the user can handle it manually.0 -
Beside the obvious that you will need to handle the 2 posting routine errors in some external table, and you will need someone to remember to check and correct these, this will not solve the problem if you can create and post through 1 company but not create the line in the other, unless you make some new tab81 line that is not data per company(you will need a storage for what has been created and posted where). Its much better to do it the navision std way ie. ic posting. And again that will work in any case since there is mapping from company to company of f.ex. dimensions. You loose that feature doing it the other way. If you want to use NAS use it to pump the docs through the ic. Then you will also only need 1.0
-
Nah I would say different from what you would prefer perhaps. It has challenges to overcome, but it is actually a very good idea.Mbad wrote:Making the 2 NAS and posting automaticly is a bad idea.
0 -
I guess the customization will take a long effort , but if it is sucessful then \:D/ \:D/CA Sandeep Singla
http://ssdynamics.co.in0 -
I really don't think there is a universal answer as to which is best, i.e. using NAS (or any other automated procedure such as OnTimer) or if someone should manually post.
Both solutions have pros and cons, and I have used both solutions for different clients. And I would say that both are valid but for different business needs.
For example, the automation can be abused, since it misses out that checking stage. In fact it all comes down to push vs pull. I.e. in one scenario. A user in one company creates journals and transactions that are then pushed to the other company without the knowledge of that other company. In the other case, the journals are pulled itto he other company and reviewed by someone in that company before being accepted and posted. If these really are two completely different companies, such as in a holding company scenario, then definitely I would suggest the manual option. If it is really just divisions run by the same people, and separated for other business reasons, then use an automation.
I think both philosophies are correct, but for different business scenarios. BTW its very dangerous in this industry to get stuck in a track of "yeah I had a client like that once, this is how we did it, so lets do it the same for every one." that only works for verticals.David Singleton0 -
In our scenario they are just divisions of the same companmy and only due to some reasons we have to have them as seprate company inn Navsion. They are also geographically dispersed with seprate reporting requirement. Tax laws in India are very strange and cumbersome.
I will go for 2 NAS solutions and will look forward to develop it with my techies. Will contact the forum for problems and results.CA Sandeep Singla
http://ssdynamics.co.in0 -
ssingla wrote:I will go for 2 NAS solutions and will look forward to develop it with my techies. Will contact the forum for problems and results.
... and I will assist you as much as possible ...
It was nice to hear that it wasn't in fact a bad solution ... especially because I have used this method a numerous times for customers ... . Thanks Guys [-o<0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 117 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
- 333 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 991 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


