4 Replies Latest reply on Jul 19, 2015 11:51 AM by tays01s

    Re-setting a record's date

    tays01s

      Title

      Re-setting a record's date

      Post

      I've a script to create new records in Calc with a 'cut-out' line where if the TO Calc|Today::_PatientID, not IsEmpty than there's a warning. This works fine, but because the new Calc automatically sets today's date and after a weekend you want to record a Calc for the missed days, it would be good to re-set the Calc::date. I can do this, but if I try to get another new Calc for today, I get the warning.

      Relationships:

      Patient::__ID = Calc::_PatientID

      Patient::__ID = Calc|Today::_PatientID and Patient::Date current = Calc|Today::Date calc

      What I don't understand is that once I've changed the Calc|Today::Date calc date, Calc|Today should be empty of Calc|Today::_PatientID since there are no current dated records and therefore should not trigger the script warning. Evidently I'm missing something!!

        • 1. Re: Re-setting a record's date
          philmodjunk

          That seems backwards. Isn't Date current an unstored calculation field that thus always returns today's date? If so, then why would you need to change the date calc field? With each new day, this relationship should fail to point to a record in Calc unless you have records with future dates in them.

          • 2. Re: Re-setting a record's date
            tays01s

            Date current: yes, always today's date. The reason Date_calc needs to be modifiable, is that on Monday a user may need to create 3 records: Sat, Sun, Mon. The first record he/she creates will have Monday's date, so they need to modify to Sat. That works, but when you try to create another record, the warning shows saying there's already a record for this date. Since I'm change away from today's date, I don't understand why such a record is found.

            • 3. Re: Re-setting a record's date
              philmodjunk

              Perhaps you just need to commit records immediately after changing the date field, but what exact "warning" have you set up here? From what context does it evaluate?

              • 4. Re: Re-setting a record's date
                tays01s

                So far on testing, you are right, it needed a 'commit on modify' script on the date field.

                Thanks,

                Stephen