Changing Company while processing

I am creating a file of Due To / Due From General Journal transactions for a group of related companies, all residing in the same database. I have figured out how to do simple accesses of another company’s tables using the CHANGECOMPANY function, but not how to run a complex process such as Codeunit 12 for a different company. To phrase it differently, I wish to login to Company A, create some transactions in a table shared by all companies, then post those transactions within Company B. And I want this to happen in a user transparent fashion (i.e. no logging out and logging back in).

CHANGECOMPANY is the only way to read from/write to tables from other companies in the database. In case you really have to use the complex posting routines, there’s no other way than adding a function to the routine to switch all tables used to the other company, and back. Be careful to do this also for all routines which are called during the process, as other tables might be used in that called routine. Be aware it is quite risky and cumbersome, meaning that, although it is possible, you should have analyzed first that it really is the only way of doing it in this way. Do also consider the maintenance aspect - it surely is something you will have to redo for each new version of Navision in the future. John

CHANGECOMPANY is the only way to read from/write to tables from other companies in the database. In case you really have to use the complex posting routines, there’s no other way than adding a function to the routine to switch all tables used to the other company, and back. Be careful to do this also for all routines which are called during the process, as other tables might be used in that called routine. Be aware it is quite risky and cumbersome, meaning that, although it is possible, you should have analyzed first that it really is the only way of doing it in this way. Do also consider the maintenance aspect - it surely is something you will have to redo for each new version of Navision in the future. John

CHANGECOMPANY is the only way to read from/write to tables from other companies in the database. In case you really have to use the complex posting routines, there’s no other way than adding a function to the routine to switch all tables used to the other company, and back. Be careful to do this also for all routines which are called during the process, as other tables might be used in that called routine. Be aware it is quite risky and cumbersome, meaning that, although it is possible, you should have analyzed first that it really is the only way of doing it in this way. Do also consider the maintenance aspect - it surely is something you will have to redo for each new version of Navision in the future. John

CHANGECOMPANY is the only way to read from/write to tables from other companies in the database. In case you really have to use the complex posting routines, there’s no other way than adding a function to the routine to switch all tables used to the other company, and back. Be careful to do this also for all routines which are called during the process, as other tables might be used in that called routine. Be aware it is quite risky and cumbersome, meaning that, although it is possible, you should have analyzed first that it really is the only way of doing it in this way. Do also consider the maintenance aspect - it surely is something you will have to redo for each new version of Navision in the future. John

Moderator - Obviously the reply above was posted a couple of times too much. Glitch in the connection, I think. Please remove.

If you could get a client running for each company you could create a kind of a “messsage handler” through your distributed table and give the running client which is running the “messsage handler” the command to execute cu12 for a certain record in the actual company.

Based on the answers at this point, which are consistent with our thinking prior to posting the query, it looks like manual intervention (i.e. having the operator login company by company and post) is our only cost effective option. We appreciate your assistance.

Navision used to offer a free “intercompany” addon. They stopped offering it themselves, but some NSCs still offer it, including my former employer, Enterprise Management Solutions, Inc. (Their web site is useless, but you can email them at Bill.Malcolm@emsolution.com or phone them at 1-603-632-7200.) This addon, which is a good example of how to use the intercompany functionality, basically allows you to balance a trabsaction for one account in one company against an account in another company. It needs “due-to” and “due-from” accounts in each company— and these have to be cleared manually using General Journal entries. You could probably write a batch job to do the same thing— but even then you still basically need manual intervention to clear the intercompany accounts. ------- Tim Horrigan