Options

How to find if Table exist in navision 3.70?

toniMtoniM Member Posts: 11
hi
I am totaly new in navision. I had no experience.
I need to check run-time if a table with given No exist in database. How I can do this without to rise exception?

Comments

  • Options
    Timo_LässerTimo_Lässer Member Posts: 481
    Define a global variable "Object" as Record to the table Object.
    IF Object.GET(Object.Type::Table,'',YourGivenTableNo) THEN
      DoWhatYouWant;
    
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • Options
    JohnJohn Member Posts: 43
    You can do a FIND on Table Object.
    Create a form with the wizart using table "Object" to see what fields are availlable. You won't find the table "Object" in the object designer

    What are you doing anyway? The things you are asking for are very unusual.
  • Options
    toniMtoniM Member Posts: 11
    thx

    Here is the code of Timo Lässer :
    IF(DoesTableExist(TableNo) = FALSE) THEN
       ERROR('Table %1 do not exist',TableNo) ;
    
    DoesTableExist(TableNo : Integer) Ret : Boolean
    EXIT(Object.GET(Object.Type::Table,'',TableNo) ) ;
    

    I had managed to get working
    great!
  • Options
    toniMtoniM Member Posts: 11
    You can do a FIND on Table Object.
    Create a form with the wizart using table "Object" to see what fields are availlable. You won't find the table "Object" in the object designer

    What are you doing anyway? The things you are asking for are very unusual.

    I am trying to make automation of excel reports for any table and etc.
    It is very time-consuming to work with static records, it is better to use them with RECORDREF. I am making as part from my learning a codeunit for Excel automation.
Sign In or Register to comment.