AOD results - unnamed leads not clickable

Hi,

I’ve finally managed to get AOD working (after plenty of issues with cron jobs, permissions and duplicated results - at least I’m not the only one and there were plenty of resources here to help).

My situation now is this: we have a load of imported leads on our system that don’t have names - just an organisation name. With the standard search module, both the name of the lead and the account are clickable, meaning if there’s no lead name, you can still access the record to view/edit it.

However, this isn’t the case with AOD. How easy therefore would it be to change the view of the AOD results so that both are clickable?

Thanks,
Sam

Hi Sam,

AOD uses the beans summary text to display the link and as you’ve noted in this case it’s empty. You can resolve this by changing

custom/modules/Home/UnifiedSearch.php

around line 128 there is the line:

."<td><a href='index.php?module=".$hit->record_module."&action=DetailView&record=".$hit->record_id."'>".$bean->get_summary_text()."</a></td>"

This creates the link. Changing this to:

."<td><a href='index.php?module=".$hit->record_module."&action=DetailView&record=".$hit->record_id."'>".($bean->get_summary_text() ? $bean->get_summary_text() : '----')."</a></td>"

will should add the text ‘----’ to empty leads so that there is something to click on.

Thanks for pointing this out. We’ll get a similar fix added to AOD in a future version.
Jim

1 Like

Hi Jim,

Thanks for that. I found that file in the end (after a lot of searching) and came up with a similar if statement to add “View record” here.

I don’t suppose there’d be an easy way of getting the account name from the lead to appear there if there’s no name, rather than just some placeholder text? I guess that’s be difficult, as if it’s not a lead appearing in the result, this field won’t be there…

Thanks,
Sam

Adding the link to account name should be quite simple. You can add an if statement to check if the module is leads and if it has an empty summary:

    $summary = $bean->get_summary_text();
    if($bean->module_name == 'Leads' && empty($summary)){
        $summary = $bean->account_name;
    }

This would be added just before the echo.
The line that was changed earlier would now look like:

."<td><a href='index.php?module=".$hit->record_module."&action=DetailView&record=".$hit->record_id."'>".($summary ? $summary : '----')."</a></td>"

Hope this helps,
Jim

One thing to mention is that the leads change wont be added to AOD so future upgrades may remove this change. It’s always a good idea to have a backup of any changes you may make.

Thanks,
Jim

Thanks Jim,

Just to mention I had to trim() the $summary in the if statement to get it working; it wasn’t blank. If you’re looking to improve this and can push this out official so we don’t need to reapply the fix each time, that’d be great. I’m sure it’d really help anyone in the same situation.

Thanks again for your help!

Sam