Creating Table at runtime

abhinavabhinav Member Posts: 6
all i want to do is define the structure of a table & store the data in that table during the execution of a report
just like temporary recordset in Visual Basic.

Comments

  • garakgarak Member Posts: 3,263
    ahm sorry. Why you make the same request :?:
    Take a look into your old request :!:

    http://www.mibuso.com/forum/viewtopic.php?t=24393

    And please, read the C/Side Development Introduction 1 - 3 and so an 8-[
    Do you make it right, it works too!
  • Alex_ChowAlex_Chow Member Posts: 5,063
    abhinav wrote:
    all i want to do is define the structure of a table...

    All I want to do is have you look at the responses people wrote to you in your original post.

    It's all I want. Seriously. All. :D
  • garakgarak Member Posts: 3,263
    Alex, thats all? :-D
    Do you make it right, it works too!
  • jlandeenjlandeen Member Posts: 524
    I have heard of someone doing this...by inserting records into the Object and Field tables and then accessing the newly created table object with the Record Ref variable.

    But in my mind that seems to be a whole lot of work and will require you to write a lot of code by hand to get everything done.

    The solution I've taken to using over the last little while is to create table objects that are outside of the customers range that are used for temporary in memory access only. This method provides me a Navision way of creating objects (another is to create codeunits with Get & Set Properties - but I don't like that one). This allows you to write, build and test all your code writing data to the tables using your developer license (and makes debugging very easy) and then set everything to temporary before you put the table into the live database.

    As NAV 5.0 allows you to base forms on Temporary objects (SourceTableTemporary = YES) it makes this process very easy. In the OnOpenForm trigger I write all the code that collects & populates the temporary record set.

    If you're using older versions of NAV it's more work to link a form to a temporary recordset but it can be done - see: http://www.mibuso.com/forum/viewtopic.php?t=11782&highlight=form+temperary+temporary+recordset

    The nice thing about this approach is that it allows you to encapsulate properties (i.e. fields) and methods (i.e. Triggers) together in a table object to create a Navision equivalent of an object without using up a Table license (there are some base Navision processes that follow this - just look for any Buffer tables). But this is only useful if the data is truly temporary...if there is even 1 record written to the table in any company and you are not licensed for the object everything stops.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
Sign In or Register to comment.