get_linked_beans and Deleted Records

I’m writing code that requires retrieving all Meeting records for a user. However, I can’t seem to get this to return deleted records.

// This works:
$meetings = $user->get_linked_beans('meetings', 'Meeting', Array(), 0, -1, 0, '');
// This returns an empty resultset:
$meetings_deleted = $user->get_linked_beans('meetings', 'Meeting', Array(), 0, -1, 1, '');

Any idea what’s going on? Am I missing something?

I’m about to just use an SQL query, since it’s not a complicated one.

I don’t know the answer, sorry.

There are a LOT of direct SQL queries in SuiteCRM, so you won’t be doing anything too outstanding. I would say that option also depends on other performance considerations. If you’re not going to use the Beans to traverse relationships or do any complicated processing, the direct SQL can be much faster. This is especially relevant if you want to do large operations on many records at once, and want to avoid looping.

Thanks pgr,

I ended up doing that and moving on to more productive code. :slight_smile: