+ Start a Discussion
rishi jaykar 1rishi jaykar 1 

how to get System overview page detail through Apex code?

NagendraNagendra (Salesforce Developers) 
Hi Rishi,

Here is one-way using Apex that will send the System Overview page as a PDF attachment.
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
email.setHtmlBody('System Overview Resport attached');
email.setToAddresses(new string[]{'root@eruditorum.org'});
email.setSubject('System Overview Report');

Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
efa.setFileName('systemOverview.pdf');
string partialURL = '/setup/systemOverview.apexp?setupid=SystemOverview';
Pagereference systemOverviewPr = new PageReference(partialURL);
efa.setBody(systemOverviewPr.getContentAsPdf());
email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});

Messaging.SendEmailResult[] r = Messaging.sendEmail(new Messaging.Singleemailmessage[] { email});
Hope this helps.

Thanks,
Nagendra