2 Replies Latest reply on May 18, 2010 1:59 PM by comment_1

    Script problems

    beckles88

      Title

      Script problems

      Post

      Hi All,

       

      I have created a student record system and the company want to be able to add more than one address on each student record for home, office etc. This is done via a portal. I have a list function to generate all the address fields in one field 'Full Address'. There is also a 'Current Address' field which is a yes no check box on the address portal to select which is the current address. I want to have a 'current full address' field which will give the full address for the current address so if there are three addresses only the address where yes is present in the 'Current Address' field s generated.

       

      Thanks

      Becky

        • 1. Re: Script problems
          philmodjunk

          Specify a sort on your relationship between student and address tables so that the "current" address is either the first or last row in your portal. (You can choose ascending or descending order here.)

           

          Then you can simply refer to the related record in your calculation if it sorts to be the first record or you can use the Last() function to reference it if you sort it to be the last record.

          • 2. Re: Script problems
            comment_1

             


            beckles88 wrote:

            There is also a 'Current Address' field which is a yes no check box on the address portal to select which is the current address.


            That's not the best method, because you might end up with several addresses checked as "current". It would be better to set a field in the student record with the AddressID of the selected address. Then you can use the same field to define another relationship - or use a filtered portal if you have version 11.