get table property: DataPerCompany

dule0612dule0612 Member Posts: 7
hi,

is it possible to get a certain table-property out of the sourcecode (in this case datapercompany) ?

i'm processing all fields of all tables of all companies with recordref and fieldref and do not want to repeat tables with property datapercompany=no because of the hughe number of records.

are table and field properties saved in an "unvisible-table" like field-table?

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Just an idea without testing, have you tried the object table with type TableData? My guess would be that shared tables are there with company blank.
  • dule0612dule0612 Member Posts: 7
    you are right, this will work. i checked the object table before but didn't consider the option tabledata, only the option table.
    thank you.

    best regards
    dule
  • ta5ta5 Member Posts: 1,164
    Hi

    Quite an old thread, but exactly what I was looking for...

    I have tried this:
    Object.SETRANGE(Type, Object.Type::TableData);
    Object.SETRANGE("Company Name", '');
    Object.SETRANGE(ID, 225); //"Post Code"
    //Object.SETRANGE(ID, 17); //"G/L Entry"
    IF Object.FINDFIRST THEN
      MESSAGE('Datepercompany=false')
    ELSE
      MESSAGE('Datepercompany=true (standard)')
    

    But in 2013 R2 at least I don't see a difference between Table Post Code ("Shared Table") and G/L Entry ("normal table"). What's wrong here?

    Thx in advance!
    Thomas
  • matteo_montanarimatteo_montanari Member Posts: 189
    ta5 wrote:
    Hi

    Quite an old thread, but exactly what I was looking for...

    I have tried this:
    Object.SETRANGE(Type, Object.Type::TableData);
    Object.SETRANGE("Company Name", '');
    Object.SETRANGE(ID, 225); //"Post Code"
    //Object.SETRANGE(ID, 17); //"G/L Entry"
    IF Object.FINDFIRST THEN
      MESSAGE('Datepercompany=false')
    ELSE
      MESSAGE('Datepercompany=true (standard)')
    

    But in 2013 R2 at least I don't see a difference between Table Post Code ("Shared Table") and G/L Entry ("normal table"). What's wrong here?

    Thx in advance!
    Thomas

    hi
    NAV 2013r2 due to teenant changes don't add multiple "Tabledata" record (one for every company) so this suggestion don't works anymore.
    A workaround is to check "table information" table but it's quite slow because of table record count & size field calculation.

    Bye

    Matteo
    Reno Sistemi Navision Developer
  • ta5ta5 Member Posts: 1,164
    Hi Matteo
    This works for me. An empty company field in table "Table Information" means Datapercompany=false.
    Btw: In 2009R2 both solutions work (using Table "Object" and "Table Information").
    Thanks a lot
    Thomas
  • PureHeartPureHeart Member Posts: 190
    This is now partially working (nav 2016) because the Table Information does not contain all the tables as for example the Web Service table (2000000076) is missing?!?!?! Anyone knows why? and how to have the full list of tables with datapercompany no?
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • tfranzentfranzen Member Posts: 25
    PureHeart wrote: »
    This is now partially working (nav 2016) because the Table Information does not contain all the tables as for example the Web Service table (2000000076) is missing?!?!?! Anyone knows why? and how to have the full list of tables with datapercompany no?

    In 2016 there is an new virtual table 2000000136 (Table Metadata). Simply create a list page for this table and set the filter for "Data per Company" to NO. Then you'll have the full list.
  • PureHeartPureHeart Member Posts: 190
    Of course! Thank you!
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
Sign In or Register to comment.