I have a data set to track my leads/inquiries, which I currently have sorted by _updatedDate and is working fine.
However I’m adding a button to sort by the date my clients are inquiring for, so I can see those for the most recent dates first, and it’s not working at all.
From what I can see, it just sets the sort to createdDate again.
The sort function itself works fine by sorting by any other filter, but not this.
Im filling the prefferedDate field of my dataset using an “after Query” data hook, could this be whats messing with the sort?
(I’m doing it this way as my leads are referenced to a diary dataset, which is the date they are inquiring for. And as I already have a few hundred leads, it was faster to write a hook then go through the database and fill the new date field (preferredDate) by hand.
I’ve also noticed that as soon as I delete the datahook code, all of the preferredDates disappear. I assumed they would stay in place?
Could this be the issue here, I wanted a little advice before I start chopping code apart again. I’ve noticed datahooks can be a fast way to freeze up the databases!
Could anyone recommend a different Data hook that would work better? after_instert etc
Thanks for the help everyone