How can I get the database and company name?...

Steeve_globetrotterSteeve_globetrotter Member Posts: 46
Hi everybody,

In fact I have a little problem cos' I don't know how I can get the database name and the current company name...I found in some post the "Session" table...Where is this table? Which ID is it?.... 8-[

I want to display this in a form only.

Thanks a lot for your help...

Steeve Le Provost
http://www.steeve-leprovost.fr.cx

Answers

  • NagiNagi Member Posts: 151
    Hi,

    If you access the CAL symbol menu (F5), you can choose DATABASE in the left panel, and then you'll get access to different functions that will retrieve information about the current database.

    COMPANYNAME will give you the name of the current company. I'm not sure which function will give you the name of the current database, but you can always test the different functions by adding them to a MESSAGE function:

    MESSAGE('Company name is %1',COMPANYNAME) // Will give you company name.

    Hope this helps!

    Cheers!
  • Steeve_globetrotterSteeve_globetrotter Member Posts: 46
    Hi Nagi,

    Thanks for your help...It's correct for the COMPANYNAME...I didn't see that...The first step is finished... :P

    But know I need the database name and I can't finf information about this on the forum... #-o

    Anyone for this ? lol :?:

    Thanks again

    Cheers

    Steeve Le Provost
    http://www.steeve-leprovost.fr.cx
  • danlindstromdanlindstrom Member Posts: 130
    Databasename can be fetched from

    In SQL
    system-table 2000000048 Database
    set a filter on the field 'My Database' = TRUE
    In Native
    system-table 2000000010 Database File
    or 2000000009 Session
    set a filter on the field 'My Session' = TRUE

    These tables can only be accessed through variables in other objects (not shown in object designer)
    Regards
    Dan Lindström
    NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
    MBSP Developer for Microsoft Dynamics NAV 2009
  • Steeve_globetrotterSteeve_globetrotter Member Posts: 46
    Hiiii

    Thanks a lot, it works perfectly like this... \:D/

    Have a good day !

    Steeve Le Provost
    http://www.steeve-leprovost.fr.cx
Sign In or Register to comment.