Method Community

 

Inserting Records Into Tables

Last post 10-27-2009 12:26 PM by Anonymous. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 10-21-2009 9:47 AM

    • Joe
    • Top 50 Contributor
    • Joined on 08-17-2009
    • Posts 97

    Inserting Records Into Tables

    Is it possible to insert a record between two others in a table?

    Example:

    Table before insertion:

    Record#  |  Data

          1              aaa

          2              bbb

    Table after insertion:

    Record#  |  Data

          1              aaa

          2              ccc        -- new record

          3              bbb

    --------------------------------

    Thx,

    ~Joe

  • 10-21-2009 3:59 PM In reply to

    Re: Inserting Records Into Tables

     Hi Joe,

    Yes, you can insert a record between two others, by using the idea below since we cannot change the Record ID of a field.

    To do so, add a field to your table with an integer type and add it into your grid. For example, your field name can be 'Order By' and then you add it to your grid, then sort your grid based on that column. You can take this even further by adding actions which would allow you to manually manipulate the number and order. Similar concept to how the "Order" column works when you are adding actions to a field or object. You can change the action order number manually and it automatically places it in the new position numerically. Let me know if this would be an alternative for you.

  • 10-22-2009 9:15 AM In reply to

    • Joe
    • Top 50 Contributor
    • Joined on 08-17-2009
    • Posts 97

    Re: Inserting Records Into Tables

    Hi Amanda.

    This is a good work-around for creating the desired grouping on the visual level.

    The reason though, that I was asking if it were possible to insert between two records on the table level, was to avoid needing that additional column. To conserve space I was grouping by record number (record:X to record:Y), and just putting all grouped records consecutive in the table.

    When i have time i may go this route for a little challenge:

    Even though you cannot change the record number directly, I could probably create a slightly complicated insertion screen that asks where the new record is to be input.

    If the number given is greater than, or equal to, the max record number, add it to the end of the table.

    If the number given is between 1 and the max record number, move all record data from the given record and below down one row. Then insert the new values at the specified record.

    If the number given is less than 1, set the value to 1 and follow the previous step.

    -----------------------------------------------------------------------------------------------------------------

    Due to how method works with table traversal, i imagine this would be a slooooow process.

    But, I do believe i can do it. Not yet sure if its worth the time hehe =).

    Let me know your thoughts :) .. even if you think it's a bad idea its nice to hear others' views hehe ;-),

    ~Joe

     

     

  • 10-23-2009 8:38 AM In reply to

    Re: Inserting Records Into Tables

     Hi Joe,

    Let me test this out on my end then I'll let you know my findings :)

  • 10-23-2009 10:51 AM In reply to

    • Joe
    • Top 50 Contributor
    • Joined on 08-17-2009
    • Posts 97

    Re: Inserting Records Into Tables

    Its not important enough for me to ask you to spend too much time on it.

    I was more curious if you felt this was a worthwhile thing to do.

    Its only value i see would be to maybe conserve a little space and have the ability to put records anywhere in the table.

    The potential to do it is there, but...

    I'm not sure thats enough reason to create such a complexity for such a simple functionality.

    ~Joe

  • 10-27-2009 12:26 PM In reply to

    Re: Inserting Records Into Tables

    Answer

     Hi Joe,

    My interpretation of your alternative is that you want to 'indirectly' change the record ID by moving the insertions up or down and ultimately changing the record ID. It doesn't seem like the best route since we cannot alter the record ID.
    You mentioned that you are trying to conserve on space so that's why the work around I provided may not be feasible. If you are putting these into a grid then you can always hide/show that column or just hide it altogether and only if someone wants to change around the order then go in and show that "Order By" column.

Page 1 of 1 (6 items)