3 Replies Latest reply on May 7, 2014 8:22 PM by herrmy76

    Repeating Field Calculation



      Repeating Field Calculation



           I have 2 fields with 5 reps each.

           Field Name: bidtype_number (5 reps)

           Field Name: bidtype_date (5 reps)

           I have entered "1" into bidtype_number and the below script returns the date in bidtype_date

           If [bid cost::bidtype_number = "1"]

           Insert Current Date [Select; bid cost::bidtype_date]

           Script Trigger = OnObjectValidate and i have attached it to this script.

           I would like to make this work for the next 4 repeating fields.  How do i make the data in the second repetition of bidtype_number result as a date in the second repetition of bidtype_date?


           It should look something like this...

           Bid Number              Bid Date

                   1                        01/05/2014

                   2                        04/05/2014

                   3                        07/05/2014  




        • 1. Re: Repeating Field Calculation

               It would be a more optimum design to NOT use repeating fields here, but to use a related table of records in a portal where each portal row replaces one of your repetitions of these repeating fields.

               but if you want entering data into a given repetition of Bid Number to record the current date in the corresponding repetition of Bid Date:

               If [ Not IsEmpty ( bid cost::BidType_Number [ Get(ActiveRepetitionNumber) ] ) ]
                   Set Field [bid cost::BidType_Date [ Get(ActiveRepetitionNumber) ] ; Get ( CurrentDate ) ]
               End If

          • 2. Re: Repeating Field Calculation

                 ... or without any trigger and script, you can make the BidType_Date a calculation field, result date, with calc:

                 trigger = bidtype_number ;
                 Get ( CurrentDate )

            • 3. Re: Repeating Field Calculation

                   thanks - the BidType_Date as a calculation works really well.