Skip to content

Commit

Permalink
Added Welcome page debug message
Browse files Browse the repository at this point in the history
See issue
#1
10
  • Loading branch information
afawcettffdc committed Feb 10, 2015
1 parent abc45f1 commit df849ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rolluptool/src/classes/RollupService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
*
* TODO: As this class has developed to support schedule and develoepr API entry points some further refactoring for reuse can be done
**/
global with sharing class RollupService
global with sharing class RollupService
{
global static Exception LastMetadataAPIConnectionException {get; private set;}

global static Boolean checkMetadataAPIConnection()
{
try {
Expand All @@ -45,8 +47,10 @@ global with sharing class RollupService
queries.add(remoteSites);
service.listMetadata(queries, 28);
} catch (Exception e) {
LastMetadataAPIConnectionException = e;
return false;
}
LastMetadataAPIConnectionException = null;
return true;
}

Expand Down
5 changes: 5 additions & 0 deletions rolluptool/src/classes/WelcomeController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public with sharing class WelcomeController {
public String MetadataResponse {get;set;}

public Boolean MetadataConnectionWarning {get;set;}

public String MetadataApiException {get;set;}

public PageReference checkMetadataAPIConnection()
{
Expand All @@ -48,6 +50,9 @@ public with sharing class WelcomeController {
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, 'A Remote Site Setting must be created in your org before you can use this tool.'));
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Error, 'Press the Create Remote Site Setting button to perform this step or refer to the post install step below to perform this manually.'));
MetadataConnectionWarning = true;
MetadataApiException = '';
if(RollupService.LastMetadataAPIConnectionException!=null)
MetadataApiException = RollupService.LastMetadataAPIConnectionException.getMessage();
}

return null;
Expand Down
3 changes: 3 additions & 0 deletions rolluptool/src/pages/welcome.page
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ function createRemoteSite()
</apex:outputPanel>
<p><b>Overview:</b> This is a tool that helps address a current platform limitation around rollup summaries. Specifically the inability to do rollup summaries between lookup relationships. This is possible between master detail relationships using the declarative mode of Force.com, but not between lookup relationships. You can read more about the tool and watch a video demo by reading this <a target="_new" href="http://andyinthecloud.com/2013/07/07/new-tool-declarative-rollups-for-lookups/">blog</a>.</p>
<p>Release details can be found <a target="_new" href="https://github.com/afawcett/declarative-lookup-rollup-summaries">here</a>.</p>
<apex:outputPanel rendered="{!MetadataConnectionWarning}">
<p style="color:gray">DEBUG USE ONLY: {!metadataApiException}</p>
</apex:outputPanel>
</apex:form>
</body>
</apex:page>

0 comments on commit df849ad

Please sign in to comment.