Company name of the record

Does anyone know how to get name of active company on the Record? In Navision is function, that allows us to change company on the record: Record.CHANGECOMPANY(New company); But is there any way how to read it back? something like CompanyName := Record.GetCurrentCompanyName ? Michal

This is stored in the database table. I have found it accessible by using the F5 function when coding. In version GB2.60a this is : Database>>Functions>>COMPANYNAME

Hi Dean thanks for the tip, but this function will return the “default” company - the one that you can see on top bar. What I am looking for is name of the company, that was assigned to the record. A small example: - We have opened Navision company “CompA” - In “CompA” we run process, that uses following statement: rec.CHANGECOMPANY(‘CompB’); The COMPANYNAME returns “CompA”. But I need some function, that would return “CompB” - the company where is “rec” now. Michal

Hi, I have the same problem. It is not possible. I created Global variable in Table CorrentCompanyName and function that ChangeCompany2(Name) { CorrentCompanyName := Name; ChangeCompany(Name); } You must this for all tables you need. Valentin Gvozdev BMI Inc.

Records do not have the information about the company-name. This is, because Navision does not save all the companies in one table. If you have two companies, navision saves the recordsets into two tables, each table for one company.

quote:


If you have two companies, navision saves the recordsets into two tables, each table for one company.


Is that confirmed? I heard the opposite: Navision stores the data in one table and the companyname is nothing more that a invisible field which exists in every table. ------- With best regards from Switzerland Marcus Fabian

In C/SIDE You’re right Marcus. The companyname is infact a part of every key in a table. Steffen might be reffering to SQL Server Option where the the data is stored in separate tables. //Lars Edited by - Lars Westman on 2001 May 04 13:33:59