How to identify reports or groups that reference specific views?

We're experiencing periodic slowdowns in our recently-upgraded Sage CRM 7.2 system, and see a lot of these kinds of errors:

You may need to recreate views manually. : SQL Error

Well, we should clean those out anyway. When I try to edit some of our views, I see an error message warning:

Any SELECT statements on Primary Entities in this view must also retrieve the _secterr, _createdby, _channelId and _primaryUserId (or _assignedUserId) colums for EACH primary entity referenced in this view.

That would pretty much include every view we've created. The good news is, most of those views are outdated and can be deleted, but I keep getting error messages saying:

Cannot delete, this view is in use by a report and/or group

How can I tell where those views are being used? Which tables can I check in the database, or screens on the GUI?


Thanks -


-Andrew-

  • 0

    You can use this, just add a where clause on the view name if you want to find specific ones:

    SELECT Repo_Name as 'Report name', Repo_Category as 'Report Category',ReBa_ViewName as 'Source View'
    FROM Custom_Reports
    LEFT JOIN Custom_ReportBands on Repo_ReportId = ReBa_ReportId
    ORDER BY Repo_Category, Repo_Name

  • 0

    Thanks!

    I'd just gotten that far myself, and determined the views I'm trying to delete aren't in use on any of the tabs/lists/blocks/screens/reports in the GUI. Refreshed all the metadata, in case something was cached. But I'm still getting the same "Cannot delete" message, so the system is convinced the views are linked to *something*, despite my personal belief to the contrary. Perhaps this is because they're linked to a component?

    Forgot to clarify, we've just upgraded from 7.1g to 7.2.e.1, if that makes a difference.

    BTW, I sent a complaint to Weyland-Yutani about an issue with a freighter we leased from you guys -- there seem to be some kind of acid burns all through the ship, sometimes going through several decks -- and I haven't gotten a reply yet. Could you see if you could escalate it with your customer service people, please? I'd post in the WY support forums, but they seem to be offline at the moment. Our Wey-Yu rep is Carter Burke, if that helps.

  • 0

    I'd run a SQL trace if I were you, see what it is doing and see where it is finding the view.

  • 0

    Export it to a table in SQL, then just use a where clause where TextData LIKE '%viewname%'

  • 0

    I just happen to be plowing through a trace even as we speak. It's one of those needle-in-a-haystack deals, with a couple of thousand records from the few relevant minutes.

  • 0

    Thanks, trying that now.

  • 0

    Unfortunately, we never got good insight into everything referencing the view, even after doing a trace.

    While we haven't seen any errors caused by references to these views recently, it'd still be good to purge them from the system, since they're just clutter now.