Jump to content
Sign in to follow this  
astock

Transfer the last value of a field

Recommended Posts

Is it possible to transfer the last value of a field into the field of a new page?
Example: The final balance yesterday is the opening balance today.

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Since my last post I have been dealing with the problem. I try to ask the question differently.

Is it possible to display the last value that a user has entered in the admin template?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...