Announcement

Collapse
No announcement yet.

Accessing Original Value of Field

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing Original Value of Field

    I thought I came across a macro at one time that gave the original value of a field. I can't seem to find what I need now.

    I want to check the original value of a field onAfterUpdate (or onBeforeUpdate) to see if the field changed. If the original value was No, and the new value is Yes, I want to do something onAfterUpdate.

    Other than doing a query on the value onBeforeUpdate, is there a macro that I can use to find the original value of the field?


    Thanks!

  • #2
    Not if it has changed, apart from doing the query 'by hand' since it likely hasnt saved yet.

    Comment


    • #3
      I didn't find exactly what I wanted, but this will work OK during onBeforeUpdate -

      if (sc_changed({approved}) && {approved} == 'Yes') {
      {approved_date} = sc_date(date('Ymd'), "yyyymmdd", "-", 0, 0, 0);
      }

      This macro returns true if the field has changed from its original status.

      It does not work too well on the editable grid if you change several times in one session, but should work for most cases.

      Comment

      Working...
      X