Options

C/AL Question - get current machine and Table question

nboettchernboettcher Member Posts: 14
edited 2013-12-09 in NAV Three Tier
I'm working on a project that involves some C/AL code and DotNet interop. I am .NET developer, looking to gain some traction in C/AL code.

Two Questions:

1. How can I get the current machine name in C/AL? I tried using the Active Session record and getting the ."Server Computer Name" but got an error "no Active Session within the filter"
2. How can I tell if a record's database table is per company or if it is a "global" table, such as User or Object?

Thanks!

Comments

  • Options
    geordiegeordie Member Posts: 655
    1. Use Session table filtering "My Session" = TRUE and you'll get the machine name from "Host Name" field. In case of RTC it will contain the NAV server name: are you looking for it or for client name?
    2. From object designer explore table properties and check DataPerCompany, which is set to yes by default.
  • Options
    DuikmeesterDuikmeester Member Posts: 304
    @2 you can use the table "Table Information". All tables with T2000000028.GET('',MyTableNumber) are tables with DataPerCompany = No
Sign In or Register to comment.