Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
0
Apex List View
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-15-2008 01:46 PM
Hi Everyone,
I have been stuck at a point for a long time. Kindly help me out.
1. I have created a Apex Page (Tab) where I am Displaying all the Activities in a list view, Now, when i click on the Subject (Hyperlinked with Event Id), The Page URL still remains that of the Previous Page. I have created a Apex Detail page for "Event" where i need to use the Event Id for displaying Additional details.
In the second Page "Event" I am using
I have been stuck at a point for a long time. Kindly help me out.
1. I have created a Apex Page (Tab) where I am Displaying all the Activities in a list view, Now, when i click on the Subject (Hyperlinked with Event Id), The Page URL still remains that of the Previous Page. I have created a Apex Detail page for "Event" where i need to use the Event Id for displaying Additional details.
In the second Page "Event" I am using
ApexPages.currentPage().getParameters().get('id') for capturing the Id of the Event. But this
is not working as the previous page never returned the Event Id in the URL.
Please Let me know, If from the List view, How i can get the Normal Salesforce Url as lik : http://salesforce.com/00UT0000001WcC9
Below are my Attached Code. Page Code -
Code:<apex:page Controller="CallCode" tabstyle="Event">
<apex:form >
<apex:pageBlock Title="Activity/Event Management" mode="view">
<apex:pageBlockButtons location="Top">
<apex:selectList value="{!ActivityType}" size="1">
<apex:selectOptions value="{!items}"/>
</apex:selectList>
<apex:commandButton value="Create" action="{!Submit}"/><p/>
</apex:pageBlockButtons>
<apex:selectList id="CallsListView" value="{!ListCalls}" size="1" onChange="{!allcalls}">
<apex:selectOption itemValue="My Calls" itemLabel="My Activities / Events">
</apex:selectOption>
</apex:selectList>
<apex:outputPanel id="out">
<apex:actionstatus id="status" startText="Loading Calls....">
<apex:facet name="stop">
<apex:outputPanel >
<apex:pageBlockTable value="{!allcalls}" var="call">
<apex:column >
<apex:facet name="header"><strong>Subject</strong></apex:facet >
<apex:commandLink action="{!go}" rerender="form">
{!call.Subject}
<apex:param name="id" value="{!call.Id}"/>
</apex:commandLink>
</apex:column>
<apex:column value="{!call.whatid}"/>
<apex:column value="{!call.Id}"/>
<apex:column value="{!call.StartDateTime}"/>
<apex:column value="{!call.EndDateTime}"/>
</apex:pageBlockTable>
</apex:outputPanel>
</apex:facet>
</apex:actionstatus>
</apex:outputPanel>
</apex:pageblock>
</apex:form>
</apex:page>
ActivityTab
Code:public class CallCode
{
public PageReference go()
{
PageReference pageRef = new PageReference('https://tapp0.salesforce.com/'+Syst em.currentPageReference().getParameters().get('id' ));
pageRef.setRedirect(true);
return pageRef;
}
Event[] callList;
public Event[] getAllCalls()
{
callList = [select id,subject,ActivityDate, whatid,ownerid,whoid, StartDateTime, EndDateTime, Region__c, Division__c from Event where OwnerId = :UserInfo.getUserId() order by Activitydate Desc Limit 10 ];
return callList;
}
String s;
public String getListCalls()
{
return s;
}
public void setListCalls(String s)
{
this.s = s;
}
String ActivityType = null;
public PageReference test()
{
return null;
}
public List<SelectOption> getItems()
{
List<SelectOption> options = new List<SelectOption>(); options.add(new
SelectOption('012T00000004QEt','Branch/Office Visits'));
options.add(new SelectOption('012T00000004QGV','Case Development Meetings'));
options.add(new SelectOption('012T00000004R6o','Client/Prospect Meeting'));
options.add(new SelectOption('012T00000004R6t','Day at the Firm'));
options.add(new SelectOption('012T00000004R6u','Desktop Application Plan Presentation'));
options.add(new SelectOption('012T00000004QEy','FA/PB visit'));
options.add(new SelectOption('012T00000004R6v','Meeting with Low Adopters'));
options.add(new SelectOption('012T00000004R6w','Planning Center Presentation'));
options.add(new SelectOption('012T00000004R6y','VIP Meeting'));
options.add(new SelectOption('012T00000004R73','Collaboration with Specialists'));
options.add(new SelectOption('012T00000004R6z','FPDA Account'));
options.add(new SelectOption('012T00000004R70','Recruit Meeting'));
options.add(new SelectOption('012T00000004R6p','Regional Activity'));
options.add(new SelectOption('012T00000004REY','Management Meeting'));
options.add(new SelectOption('012T00000004R74','Specialist Professional Development'));
options.add(new SelectOption('012T00000004R79','Specialist-lead Seminar/Training'));
return options;
}
public String getActivityType()
{
return ActivityType;
}
public PageReference submit()
{
String ActivityRecordType = ActivityType;
System.debug(ActivityRecordType);
PageReference pageRef = new PageReference('https://tapp0.salesforce.com/00U/e— retURL=/home/home.jsp&RecordType='+ActivityRecordT ype+'&cancelURL=/apex/Activity–sfdc.tabName=01rT00 00000CqDx&sfdc.motif=Custom14&ent=Event');
return pageRef;
}
public void setActivityType(String ActivityType)
{
this.ActivityType= ActivityType;
}
}
Event Detail Page -
Code:<apex:page standardController="Event" extensions="MyCustomEvent">
<apex:detail />
<apex:pageblock title="FA/PB Related List">
<apex:pageBlockTable value="{!FA_Branch}" var="Temp">
<apex:column value="{!Temp.FA_PB_Name__c}"></apex:column>
<apex:column value="{!Temp.FA_PB_Branch_Id__c}"></apex:column>
<apex:column value="{!Temp.FA_PB_Branch__c}"></apex:column>
<apex:column value="{!Temp.Name}"></apex:column>
</apex:pageBlockTable>
</apex:pageblock>
<apex:pageblock title="Branch Related List">
<apex:pageBlockTable value="{!Branch}" var="Temp1">
<apex:column value="{!Temp1.Branches__c}"></apex:column>
<apex:column value="{!Temp1.Branch_Division__c}"></apex:column>
<apex:column value="{!Temp1.Branch_Region__c}"></apex:column>
<apex:column value="{!Temp1.Name}"></apex:column>
</apex:pageBlockTable>
</apex:pageblock>
</apex:page>
Event Controller -
Code:public class MyCustomEvent
{
public MyCustomEvent(ApexPages.StandardController controller)
{
}
FA_Branch__c[] MyFA_BranchId;
public FA_Branch__c[] getFA_Branch()
{
String WhatIds = ApexPages.currentPage().getParameters().get('whati d');
MyFA_BranchId = [select id,Name, Branch_Division__c, Branch_Region__c, FA_PB_Branch_Id__c, FA_PB_Branch__c, FA_PB_Name__c, Branches__c from FA_Branch__c where Branch__c = :ApexPages.currentPage().getParameters().get('id') and FA_PB_Name__c !=''];
return MyFA_BranchId;
}
FA_Branch__c[] My_BranchId;
public FA_Branch__c[] getBranch()
{
String WhatIds = ApexPages.currentPage().getParameters().get('whati d');
My_BranchId = [select id,Name, Branch_Division__c, Branch_Region__c, FA_PB_Branch_Id__c, FA_PB_Branch__c, Branches__c from FA_Branch__c where Branch__c = :ApexPages.currentPage().getParameters().get('id') and Branches__c !=''];
return My_BranchId;
}
}
Thank to you all in Advance....
Sanjay
0
Re: Apex List View
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-21-2008 03:43 PM
The code you may be looking for is located at http://wiki.apexdevnet.com/index.php/Account_recor dType in the getBasePageName section of the controller.
Good luck! If you get it to work, please share the results - this is a great project.
Good luck! If you get it to work, please share the results - this is a great project.

