5 Replies Latest reply on May 12, 2012 4:58 AM by GuyStevens

    Problem with Replace Field Contents in Script

    MorkAfur

      Title

      Problem with Replace Field Contents in Script

      Post

      I have a Replace Field Contents in a script, but I notice that each time it updates a record, it updates ALL records each time though the script. The problem seems to be that I'm missing something about Replace Field Contents.

      (Sorry if there are any code typos, I couldn't seem to copy and paste the script into this posting...)

      I have an IF statement that "should be" (at least this is my intent) updating the client's renewal field to the year 2013 if the date is before today and otherwise makes sure it's this year.

      Here's the gist of the script:
      ==================

      Go to Layout (original layout)

      Show all records

      Go to Record/Request/Page [First]

      if [(Clients::Renewal Date < Get(CurrentDate)] // this line seems to be giving the expected results

      // Next Year, same renewal month and day

         Replace Field Contents [No Dialog; Clients:: Renewal date; Month(Clents::Renewal Date) & "/" & Day(Clients::Renewal Date) & "/" Year (Get (CurrentDate)) + 1]

      else

      // this year, same renewal month and day

         Replace Field Contents [No Dialog; Clients:: Renewal date; Montn(Clents::Renewal Date) & "/" & Day(Clients::Renewal Date) & "/" Year (Get (CurrentDate)) ]

      ----------

      endif

      Look forward to any suggestions.

      Thanks.

      -m