Greetings to all.
We have been trying to do somthing interesting.(and probably unusual) We are trying to write a dataport that will enter data into various tables in various companies in Navision Financials. The CompanyChange function changes the company for that particular table.
Is there a way to change the company automatically (with C/Side) and have it changed for all objects until changed back?
Any help with this will be greatly appreciated.
regards
Craig Needham
Datrix Solutions
0
Comments
Also if you try to post a "gen. journal line" that won't work either...
Kind Regards
Henrik Helgesen,
Navision Solution Developer
Henrik Helgesen,
President | Helgesen Consulting
about.me | LinkedIN
Regards
[This message has been edited by Borislav Popov (edited 02-03-2000).]
John
All validations should take place for data integrity, but as we know validation often means jumping around to many tables to validate customer and vendor codes etc. Not all customers and vendors are the same for all companies.
There are many other validations which are done, therefore I was hoping that there would be a way tio change the companyfor all tables in one go. Tracing all tables is one thing, but updating all the validation code for those tables is not a viable solution, it will also make upgrades a nightmare.
I hope this helped to clear things up a bit.
Regards
Craig
Can you change the company on the table, or do you have to change it for all the variables that point to that table ?
My pb is : I have a dataport which change company for the sales header table, and I would like to change it for all the tables that are used in the triggers or functions called by that table.
May I change the company on the tables in my dataport c/al, or do I have to rewrite sales header c/al to point to the right company ?
It makes a lot of differences...
Just wrong Users...
There is no equivalent in C/AL of the generic change of company as done via the menu.
Interesting thought... anyone tried to "press some keys" (ctrl-O in special) with a macro program you can call with a SHELL command?
John
Sometimes we have done the validation in one company to get all the triggers to run and afterwards push over the records in the other company.
No one would be happier than me if we got a global CHANGECOMPANY. That would really be useful.
//Lars Westman
http://www.linkedin.com/in/larswestman
but at that time I wondered if I could in C/AL change my company at the core level on table, or if the change of company was stored on the variable level... that is, changing the company on a table from a dataport, and having c/al code called from another object pointing to that table and still "know" the change of company made in the dataport... <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />
I may not be clear <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" /> (my english is bad)
but in any case, it was stupid, I experienced it and can confirm the changecompany function only applies to the variable inside an object and is not stored to the basic level of object. <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />)
my question was stupid...
still looking for a solution...
Just wrong Users...
Many have been struggling with the (lack of) change company features, so your questions surely make sense.
Let's all hope that one of the next NF versions will have this solved.
As said in a different reply, an interesting thought is to see if a SHELL called macro program could be used to send the keystrokes to Navision to make a generic company change. Anybody tried this?
John
With macro program are some problems:
1. If on workstation runing more than one fin.exe instance, we need identify that fin.exe by thread or process ID. Shell cereate new thread or use the same as fin.exe? It's very easy for C/AL ? <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />
2. Then company changed fin release all obj. We need to run dataport or Codeunit again !
I think that there can help only Cfront. There are func to change commpany globaly. And no problems with spec chars unlike in dataport.