AnsweredAssumed Answered

Problem with Replace Field Contents in Script

Question asked by MorkAfur on May 11, 2012
Latest reply on May 12, 2012 by GuyStevens

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

 

Outcomes