Dynamic addition of attribute.

roshanthaparoshanthapa Member Posts: 90
Is it possible to add fields to a table and a tablebox dynamically? For example, I have 3 fields in a table and the tablebox, I want to add the 2 more fields without going to design mode in the table and the tablebox.


I don't think it can be but I just wanna be sure about it because I don't want to be with misconceptions.

Comments

  • nunomaianunomaia Member Posts: 1,153
    No, you can't
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/
  • ara3nara3n Member Posts: 9,256
    it can be done, but I would not recommend.

    To do it. All you have to do is insert into the field table.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,305
    noooooooooo don't do it!!!!

    Seriously though, you don't want to do that, it will only cause problems. Just stick to the Table design and work with the limitations of the IDE.
  • cnicolacnicola Member Posts: 181
    I liked nuno's answer better :wink:
    Apathy is on the rise but nobody seems to care.
  • DenSterDenSter Member Posts: 8,305
  • David_SingletonDavid_Singleton Member Posts: 5,479
    ara3n wrote:
    it can be done, but I would not recommend.

    To do it. All you have to do is insert into the field table.

    Keep in mind that if you do this, then not all the properties are set, so these new fields will have some strange actions. To fix it you need to open up the object designer and recompile, so since you have to open the designer, just add the fields whilst you are there.
    David Singleton
  • Alex_ChowAlex_Chow Member Posts: 5,063
    ara3n wrote:
    it can be done, but I would not recommend.

    To do it. All you have to do is insert into the field table.

    Why do you have to stir up the hornet's nest? :wink:
  • ara3nara3n Member Posts: 9,256
    Well the user was asking if it could be done. I just wanted to let them know that it can be done, but I would not recommend it.

    I've used it once to write a report to change the data type of one of the fields in 8 tables.

    The report created a new field. Moved the data from old field to new field.
    Changed the datatype to new datatype. Transfred data back into the old field. Cleared the new field and deleted the field.

    The report did on the fly and the data type was changed from option to code, linked to a table.

    The other option was to export all the data, empty the field. import the new fob, etc etc.
    And this whole time people where working on other modification in development db.

    So in order to continue development and not wait for this modification to go into production, I decided to first option.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ara3nara3n Member Posts: 9,256
    edited 2007-10-10
    The update toolkit could use this to improve the update process.
    Instead of creating new tables, move the data to new tables, and load the new objects, they could save the time and restructure the table with processing CU or report.

    Ofcourse it has limitation as David mentioned, but it is useful in certain scenarios.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ara3nara3n Member Posts: 9,256
    edit
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • David_SingletonDavid_Singleton Member Posts: 5,479
    ara3n wrote:
    The update toolkit could use this to improve the update process.
    Instead of creating new tables, move the data to new tables, and load the new objects, they could save the time and restructure the table with processing CU or report.

    Ofcourse it has limitation as David mentioned, but it is useful in certain scenarios.

    As much as I don't like messing around like this. I agree in this case, that the upgrade tool kit is one place where something like this could be used.
    David Singleton
Sign In or Register to comment.