I have set my database up so that it keeps the previous status and when you create a new status, it gets the old data as default. This allows a sort of "history" of whats going on with a particular matter.
In my main view, I am listing only the most recent status record by
- Code: Select all
function __sql__(){
return "SELECT * FROM `status` ORDER BY `StatusID` DESC";
}
then using
- Code: Select all
$related_records =& $record->getRelatedRecordObjects('status');
$content = '<b>To Do: </b>'.$related_records[0]->htmlValue('ToDo')
.'<br><br><b>Awaiting: </b>'.$related_records[0]->htmlValue('Awaiting');
The problem im facing is obviously when i click onto this status tab (up the top) it lists ALL statuses via that SQL query, So I get a table full of unwanted data. I only ened the most recent for each related record (matter).
doing LIMIT 1 just breaks everything...
Thanks in advance for all the smart people that can help me