Jump to content

Transfer the last value of a field


astock
 Share

Recommended Posts

I am not sure what you mean by the last value of a field, so my response may not be relevant to your issue.

Unless you are using some sort of version control, there is not concept of last value of field in ProcessWire. This just means that the current value of the field is the last value, so to speak. Could you expound a little bit on your context? I am guessing maybe it is something like this?

Page A: Has a field share_price that changes dynamically/regularly

At the end of business (or start of business next day) you create a page to store yesterdays last recorded share price

Page Share Price Monday: Has field share_price_monday

Etc for other days

Page Share Price Tuesday: Has field share_price_tuesday

Page Share Price Wednesday: Has field share_price_wednesday

etc...

For dynamic 'transfer' (copying of the value) you will need a hook. To trigger the hook on a non-event (for instance triggering the hook to run at the time 11:59), you will need to set up a cron job. There are modules in the forums that can do this.

Link to comment
Share on other sites

It was a bad example of mine.
Strictly speaking, it is the last mileage. The last driver enters his last mileage at the end of the trip. That should be the beginning mileage for the next driver.
So it could happen that several drivers have several entries on one day.

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...