Hi Luo,
Thanks for looking into my issue.
However filing a feature request does not solve it for me at this point.
How about if we think outside the box, and actually try to achieve this using what Toolset already has to offer?
While I was waiting for your initial reply the following idea came to me as a possible solution, but yet I'll need a bit of your help here.
So In order to better understand the problem I'm trying to solve I'll try to explain in greater detail...
I'm building a web app for managing School's Library. So I have the following setup:
CPTs:
- Books
- Readers
Relationships:
- Readers-Books
CFs:
- each have a bunch of custom fields but the most important is the Barcode ID field which I use identify Books and Readers. The Barcode ID gets programatically inserted into the Book or Readers' names upon their creation, I also use these ID's to define conditionals which deliver most of the functionality(most of it goes around using these IDs).
So when a the reader wants to take a book for reading I use a post relationship form to change the Readers-Books relationship on the desired book's page and make that point to the specific Reader ID.
Once the reader wants to return the book back to the library, I use the same form to change the relationship back so the book will be related to the Libary, where Library is also a Reader - ID = 0.
My issue is that this way I can only show the current books that a specific reader is reading at the moment, and can not tell what they've read in the past.
So here comes my idea:
- What about creating a second post relationship titled "Reader-Books-Past" which will be programatically created in cases when the Reader will return the book back to the Library using the Relationship Form? We could also programatically insert values in two required custom fields - a) rent date b) return date. Rent date we will pulled from the date when the Reader-Books relationship was created initially, and the return date will be pulled from the moment when the form is submitted.
Would this be possible? Could you give me directions on programatically creating that relationship and filling in those fields if so?
Thanks in advance!
Best,
D.