Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get a Report object using the fullName #57

Closed
afawcett opened this issue Nov 20, 2014 · 2 comments
Closed

Get a Report object using the fullName #57

afawcett opened this issue Nov 20, 2014 · 2 comments

Comments

@afawcett
Copy link
Contributor

From [https://github.com//issues/26]

"I'm having the same problem with Reports. It appears the fullName for the Report object isn't accessible via the API, so reads, updates, and deletes aren't possible. Anyone have any success here?"

@afawcett
Copy link
Contributor Author

I've been trying to use readMetadata for this, passing in the fullname as MyFolder/MyReport and its not working. However using the retrieve operation it does work. Downside here is you need a Visualforce context. However below is a screenshot of a Report retrieved this way, using the Retrieve Demo that is part of this library.

screen shot 2014-11-21 at 18 06 03

@afawcett
Copy link
Contributor Author

Ok scrub that, mix up between orgs i was coding in vs creating my report in, doh, need to step away from the keyboard! 👍 Anyway here is a working example...

public static void readReport()
{
    MetadataService.MetadataPort service = createService();     
    MetadataService.Report report = 
        (MetadataService.Report) service.readMetadata('Report', 
            new String[] { 'MyFolder/MyReport' }).getRecords()[0];
    System.debug(report.description);           
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant