I've recently created a package and I'm facing an unusual problem. Basically, in my development org, this works:

        String report = String.valueOf([SELECT Id 
                FROM   Report 
                WHERE  DeveloperName = 'Report_Unique_Name' 
                AND NamespacePrefix = 'MyPrefix'].id);

But now I've created my package and installed it in another normal org and this isn't working. The Reports and Reports Types are there and removing "AND NamespacePrefix = 'MyPrefix'" doesn't work either.

Best regards.

  • 2
    Did you check the value of DeveloperName in the org that you installed it in? It may of added the prefix on to it e.g. MyPrefix __Report_Unique_Name. The best way of debugging this issue is to use the Developer Console in the Org with the problem. Running SOQL such as SELECT Id, DeveloperName, NamespacePrefix FROM Report should show why its not working
    – BarCotter
    Feb 28, 2014 at 13:42
  • Thank you, didn't remember to use the DC. I ran a similar query and found out one of the reports was missing (I fetch three of these) and since they were surrounded by a "try" clause, one of them was failing and obviously making the other 3 also not appear. Thank you very much!
    – Rui Rocha
    Feb 28, 2014 at 15:46
  • In addition to the DevConsole, Salesforce also has the Force.com Explorer that's handy for exploring Objects/data. developerforce.s3.amazonaws.com/media/forceexplorer/… (though you can't query the Report object in the Explorer :/) Feb 28, 2014 at 19:47


You must log in to answer this question.

Browse other questions tagged .