2 Replies Latest reply on Jun 20, 2011 10:45 AM by BradenDouglass

    Appending Record to a Record in Table

    BradenDouglass

      Title

      Appending Record to a Record in Table

      Post

      Alright all, for some reason I have never run into this situation before and and besides some complex scripting, I am sort of lost. The user wants a dropdown list that contains all records in the current table (this is easy). When they select a record on this list they want the information from the selected record to be copied into the current record. I have always had users nav to the record they want to copy and copy it that way, never in this fashion. Any help on this maybe simple subject would be amazing, thank you for your time.

        • 1. Re: Appending Record to a Record in Table
          philmodjunk

          There are several ways to make data from another record and/or another table "appear" on your layout after selecting a value from the drop down.

          You can physically copy the information. With a relationship that links records based on the drop down field, this can be done with looked up value settings on the fields. Without such a relationship and field options, a script can capture data from the record selected via the drop down and then the script can start a new record, entering data from the variables into the designated fields in the new layout. If most the new record will contain the same data as the selected record, you can even duplicate the record, then use set field to clear the fields that should be empty in the new record.

          You can also just link to the same information. If you have a relationship linking the records by this drop down field's value, simply add the fields from the related table's table occurrence. This is a dynamic link where editing the data in the related table changes the value everywhere it is displayed which does not happen when you physically copy the data.

          • 2. Re: Appending Record to a Record in Table
            BradenDouglass

            Hmm, I dont want the link to be dynamic and since it is a record to record lookup in the same table, I can't really look items up aside from looking up from a table occurrence...which I guess is a "doable" option (likely the one that I will end up chosing). However, with the lookup idea I was avoiding going from item to item and explicitely telling it to look up from TO::X Field. 

            The way I originally attempted it was take the important fields in the first record and stuff them into variables. Then copy the selected record, wipe the unneeded fields to nil, then paste back in everything held in variables. Alright, if these are my only two real choices guess I am going to role some dice, thanks!