function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JohnThomasJohnThomas 

Campaign Summary Tab

Does anyone have some sample code to get me started on creating a Campaign Summary Tab that will display a sortable table containing all active campaigns at the beginning of each row, with associated campaign result fields (Total Contacts, Total Responses, Num Sent, etc.) going across to the right. I need a dropdown to select between All Active Campaigns and My Active Campaigns, then sorted by campaign Type.  This needs to be on a Tab called Campaign Metrics.
Thx.
Carl_V1Carl_V1
Given a report will provide most of that which you have described, why not create the report and then use the resultant URL to build a webtab?  Then, when the user clicks on the webtab they'll be taken straight to the report results.
JohnThomasJohnThomas
Thanks for the feedback Carl,
 
Excellent idea and that is the backup plan if I cannot get an HTML layout to work. We were wanting a specific branding look and feel for the APP the HTML s-control would provide that option over a report.
 
JT Redd
Carl_V1Carl_V1
JT,

Maybe the s-controls in this free app from sf.com on the appexchange might be a useful starting point and shorten the development cycle;

http://www.salesforce.com/appexchange/detail_overview.jsp?NavCode__c=&id=a0330000002NegDAAS


JohnThomasJohnThomas
Thanks, I'll check it out !
JohnThomasJohnThomas
ok, while not sortable (yet), I was able to display the campaigns (not IsActive=true only yet) and the associated custom fields with the code below (Draft 1) using the "dataTablecon".  My delima, at this point, is that there are too many custom fields (some unnecessary in this view) but I want to have all of them available to the user from this summary page. So I now have the additional call to display the Campaign Detail page (Draft 2) using a rerender call. But there will not be enough room on the page once additional campaigns become available in the table view.

I need to have the Campaign Detail page, for each campaign.name in the Campaign Name column, to open in a separate popup window onClick.
Any ideas on how to popup the view? 
thx,  JT

DRAFT 1:

<apex:page controller="dataTableCon" id="CampMetrx" showHeader='true'>
<apex:pageBlock title="Campaigns">
<apex:stylesheet value="{!$Resource.Global}"/>
<apex:dataTable value="{!campaigns}" var="campaign" id="MetrxTable" rowClasses="odd,even" cellpadding="10" styleClass="tableClass" bgcolor="#F3F3EC" onRowMouseOver="hiOn(this);" onRowMouseOut="hiOff(this);">
<apex:facet name="header"><b>Campaign Metrics</b></apex:facet>
<apex:column>
<apex:facet name="header">Campaign Name</apex:facet>
<apex:outputText value="{!campaign.name}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Owner</apex:facet>
<apex:outputText style="font-style:italic; font-size:12px" value="{!campaign.owner.name}"/>
</apex:column>
<apex:column>
<apex:facet name="header">Selected</apex:facet>
<apex:outputText value="{!campaign.Total_Emails_Selected__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Delivered</apex:facet>
<apex:outputText value="{!campaign.Total_Emails_Delivered__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Open</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Total_Open__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Click/Open %</apex:facet>
<apex:outputText value="{!campaign.Click_Open_Ratio__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Clicks</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Total_Clicks__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Unsubs</apex:facet>
<apex:outputText value="{!campaign.Unsubscribe_Rate__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Bounces</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Total_Bounces__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Hard</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Hard_Bounces__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Soft</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Soft_Bounces__c}" styleClass="global"/>
</apex:column>
</apex:dataTable>
</apex:pageBlock>
</apex:page>


DRAFT 2:

<apex:page controller="dataTableCon" id="CampMetrx" showHeader='true'>
<apex:stylesheet value="{!$Resource.Global}"/>
<apex:pageBlock title="Campaigns">
<apex:form>
<apex:dataTable value="{!campaigns}" var="campaign" border="1 "id="MetrxTable" rowClasses="odd,even" cellpadding="10" styleClass="tableClass" bgcolor="#F3F3EC" onRowMouseOver="hiOn(this);" onRowMouseOut="hiOff(this);">
<apex:facet name="header"><b>Campaign Metrics</b><hr /></apex:facet>
<apex:facet name="header">Campaign Name</apex:facet>
<apex:column>
<apex:outputPanel>
<apex:actionSupport event="onmouseover" rerender="detail">
<apex:param name="cid" value="{!campaign.id}"/>
</apex:actionSupport>
{!campaign.Name}
</apex:outputPanel>
</apex:column>
<apex:column>
<apex:facet name="header">Owner</apex:facet>
<apex:outputText style="font-style:italic; font-size:12px" value="{!campaign.owner.name}"/>
</apex:column>
<apex:column>
<apex:facet name="header">Selected</apex:facet>
<apex:outputText value="{!campaign.Sevista_Total_Emails_Selected__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Delivered</apex:facet>
<apex:outputText value="{!campaign.Total_Emails_Delivered__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Opens</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Total_Open__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Clicks</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Total_Clicks__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Click/Open %</apex:facet>
<apex:outputText value="{!campaign.Click_Open_Ratio__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Unsubs</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Total_Unsub__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Unsub %</apex:facet>
<apex:outputText value="{!campaign.Unsubscribe_Rate__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Bounces</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Total_Bounces__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Hard</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Hard_Bounces__c}" styleClass="global"/>
</apex:column>
<apex:column>
<apex:facet name="header">Soft</apex:facet>
<apex:outputText value="{!campaign.Cmpn_Soft_Bounces__c}" styleClass="global"/>
</apex:column>
</apex:dataTable>
<apex:commandButton action="{!print}" value="Print" id="theButton"/>
</apex:form>
</apex:pageBlock>
<apex:outputPanel id="detail">
<apex:actionStatus startText="Requesting...">
<apex:facet name="stop">
<apex:detail subject="{!$CurrentPageReference.parameters.cid}" relatedList="false" title="false"/>
</apex:facet>
</apex:actionStatus>
</apex:outputPanel>
</apex:page>




Message Edited by JohnThomas on 04-28-2008 08:27 PM