8 Replies Latest reply on Sep 19, 2014 4:07 AM by padje

    Creating a default record from the table list

    shae1725

      Title

      Creating a default record from the table list

      Post

           How could I set only one record to be a default record among a list of records from a table?

           I put a radio button in the "default field" but have no idea how to change the state of all the other records to false

           Any help would be appreciated

            

            

        • 1. Re: Creating a default record from the table list
          philmodjunk

               You mention both a default record and a default field. Which do you need?

               To change the value of a given field for multiple fields in a single "batch" operation, take a look at Replace Field Contents, which can be used with radio button formatted fields just like any other field.

               Notes:

               Replace Field contents modifies the specified field for every field in your found set. To update all the records in your table, do a Show All Records first.

               Replace Field Contents cannot be undone and can modify very large numbers of records. It can be a good idea to save a copy of your database file before trying this tool out so that you can replace your current file with the copy if you make a mistake and get results you don't want.

          • 2. Re: Creating a default record from the table list
            shae1725

                 Hi

                 Sorry Default record! the "default field" is where I have placed the radio button!

                 I am viewing the records in a portal and want to be able to change the radio button state of whatever record I need set as the default record

                 Thanks

            • 3. Re: Creating a default record from the table list
              philmodjunk

                   Please explain what you want to accomplish in more detail. (I can imagine multiple scenarios that fit my understanding of what you want.)

              • 4. Re: Creating a default record from the table list
                shae1725

                     In my table I have a field called "Default" containing "0" or "1"

                     Only one record in the table can have the "Default field"  true "1" at any one time! If I chose another record to be True , the previous records "Default field" needs to return to false "0"

                     hope Im explaining myself ok

                     Many Thanks

                • 5. Re: Creating a default record from the table list
                  philmodjunk

                       Sounds like this field is in the wrong table. If you set up a field in a related table with a single record that matches to all records in this table, you could set that field to the primary key of the record in your current table that you want to mark as "default". Since setting that field to the PK of a record in your main table automatically overwrites any previous value, one and only one record in your table may be marked in this fashion.

                  • 6. Re: Creating a default record from the table list
                    shae1725

                          ....... I have added a png! if you look to the left portal you will see 2 fields!  If I click on eg "50 40 40 40" then that will populate the relevant fields in another table!

                         All I want to be able to do is click on the default field beside any of the size fields and set that field to be "default" clearing the previous default field!

                         The default field is only  a visual aid to the user of the application! the user can choose to use it or not!

                         Its a very small table containing only 30 records max

                    • 7. Re: Creating a default record from the table list
                      philmodjunk

                           That is consistent with my reasons for making my suggestion.

                      • 8. Re: Creating a default record from the table list
                        padje

                        Sounds like this field is in the wrong table. If you set up a field in a related table with a single record that matches to all records in this table, you could set that field to the primary key of the record in your current table that you want to mark as "default". Since setting that field to the PK of a record in your main table automatically overwrites any previous value, one and only one record in your table may be marked in this fashion.

                        Hey PhilModJunk (or another member),  

                         

                        could you point me a little bit more in the right direction ? 

                        I did what PhilModJunk suggested, but some off the suggestions are not clear to me.

                        I can add several addresses related to a person.  These show up in a portal (addresses from person) on person layout.

                        I added a checkbox default.  If I check an address as default, it appears in a portal from a second TO of address  (= default address from person)

                        Only thing I can not get working is, when selecting another default address, the first one selected does not deselect.

                        In attachment you find a screenshot of my file.  mf_default_adres = 1 or 0  (the file is half in Dutch, haf in English)

                        b_default is also a value of 1  (if default) or 0

                        Some help with the last step, how to automatically uncheck a record and check a new one, would be much appreciated.

                        I could do that by scripting, but it seems that with the right relations, this should happen without scripting ?

                         

                        Thanks in advance