• witoutme247
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies

I need to be able to create custom list views invloving filter criteria from fields in Activities, Accounts and Contacts.

For example: I need a list of all followup reminders for Accounts in CA with Contacts in HR department.

Currently the standard activity list view only shows filter criteria from activity fields. How do I do this?

I have a batch apex - this queries the task table.

I need th query to return all activities till date - including archived activities. The API has a queryALL call that does this, but I haven't found a similar one in apex. Adding ALL ROWS to the end of the SOQL query doesn't work

Any help will be greatly appreciated. Thank you

-VJ

PS: this query is inside the execute method.

This is something that astounds me. Can someonn tell me if there is a way around?

Requirement: Opportunity Stage is set depending on bunch of 9 other picklist values (basically the rep picks the things that are done, and this in turn feeds/computes the stage).

Problem: Stage is a required field. Record cannot be saved without a value in it. Workflow field update and before triggers do not work.

Simple workaround: Set the default value of the stage on creation to the first stage. BUT this is not possible as stage default value cannot be set!!!!!Only scenario where an opportunity’s stage can be set by default is when doing a lead conversion. 

This is just unbelievable. Help!

PS: I have multiple record types for multple sales process.

Message Edited by witoutme247 on 01-13-2010 04:21 AM
I have a dynamic query

'SELECT Id,Description, Phone, Otherphone,Account.Phone,ReportsToId, AccountId, ReportsTo.Title,ReportsTo.FirstName,ReportsTo.LastName FROM Contact where Account.Target_Account__c = true and Relevant_Contact__c=true and Phone!=null and OtherPhone!=null and Email!=null and Title!=null and ReportsToId != null and ReportsTo.Title!=null and ReportsTo.FirstName!=null and ReportsTo.LastName!=null'

 

assigned to List<Sobject> scope.

 

When I do a scope.getSobjectType(), it says 'Contact'. Which is fine.

But in my query, I'm also getting the Accounts Phone number and another contacts details (ReportsTo -<lookup onto contact).

How do I get these extra info out of scope? is it possible?

Any help will be greatly appreciated.

Thank you

-VJ

I'm building a task detail page with hover links in the bottom (similar to related list hovers). The difference is these links will display information according to our custom logic.

In this demo, I have two outputtext in the bottom of the detail page, each with actionSupport tags associated with them. The problem is, when I hover over the first text, the action from the second actionsupport executes. Irrespective of the number of outputtext+actionsupport, the action executed is always the last actionsupport tag. I dont understand if I'm missing something. I always end up rerendering the last pageblock again and again.

Please help.

The VF Page

 

<apex:page standardController="Task" sidebar="True" Title="Task:" extensions="HyperTaskDetail" action="{!onload}">
<apex:detail subject="{!task.Id}"/>
<apex:param name="infoid" value="{!task.WhoId}"/>
<apex:form >
<apex:outputPanel >
<table width="950" border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="top" >
<td height="26" > <u><apex:outputText value="Call Completed - With Relevant Contact [{!ccRCsize}]"/></u>
<apex:actionSupport event="onmouseover" action="{!callRC}" rerender="panel"/>
</td>

<td height="26"> <u><apex:outputText value="Call Completed - Team Call [{!ccTCsize}]"/></u>
<apex:actionSupport event="onmouseover" action="{!callTC}" rerender="panel"/>
</td>

</tr>
</table>
</apex:outputPanel>
</apex:form>
<apex:outputPanel id="panel">
<apex:pageBlock id="block1">
1:{!render1},2:{!render2},3:{!render3},4:{!render4}
<apex:outputPanel id="info1">
<apex:pageBlockTable rendered="{!render1}" value="{!CallCRC}" var="c1"title="Call Completed - With Relevant Contact">
<apex:facet name="caption"><strong>Call Completed - With Relevant Contact</strong></apex:facet>
<apex:column > <apex:facet name="header"> Assigned </apex:facet>{!c1.Owner.Name}</apex:column>
<apex:column > <apex:facet name="header"> Subject </apex:facet>{!c1.Subject}</apex:column>
<apex:column > <apex:facet name="header"> Status </apex:facet>{!c1.Status}</apex:column>
<apex:column > <apex:facet name="header"> Comments </apex:facet> {!c1.Description} </apex:column>
</apex:pageBlockTable>
</apex:outputPanel>
<apex:outputPanel id="info2" >
<apex:pageBlockTable rendered="{!render2}" value="{!CallCTC}" var="c2"title="Call Completed - Team Call">
<apex:facet name="caption"><strong>Call Completed - Team Call</strong></apex:facet>
<apex:column > <apex:facet name="header"> Assigned </apex:facet>{!c2.Owner.Name}</apex:column>
<apex:column > <apex:facet name="header"> Subject </apex:facet>{!c2.Subject}</apex:column>
<apex:column > <apex:facet name="header"> Status </apex:facet>{!c2.Status}</apex:column>
<apex:column > <apex:facet name="header"> Comments </apex:facet> {!c2.Description} </apex:column>
</apex:pageBlockTable>
</apex:outputPanel>

</apex:pageBlock>
</apex:outputPanel>
</apex:page>

 

The extension:

 

public with sharing class HyperTaskDetail {
private final Task t;
public Boolean render1{get; set;}
public Boolean render2{get; set;}
public Boolean render3{get; set;}
public Boolean render4{get; set;}

public HyperTaskDetail(Apexpages.StandardController controller){
this.t = (Task)controller.getRecord();
}
public List<Task> tList = new List<Task>();
public List<Task> ccRC {get; set;}
public List<Task> ccTC {get; set;}
public List<Task> ccAM {get; set;}

public List<Task> ccO {get; set;}
public PageReference onload(){

render1=false;
render2=false;
render3=false;
render4=false;
if(t.WhoId!=null){
tList = new List<Task>();
for(Task tk :[select Id, Owner.Name, WhoId, Status, Subject, Description, Type from Task where WhoId = :t.WhoId]){
tList.add(tk);
}
System.debug('ALL TASK LIST---'+tList);
}
getCallCompletedRC();
getCallCompletedTC();
getCallCompletedAM();
getCallCompletedO();
return null;
}
public List<Task> getCallCompletedRC(){
ccRC = new List<Task>();
for(Task tk: tList){
if(tk.Type.contains('Call Completed - With Relevant Contact')){
ccRC.add(tk);
}
}
System.debug('ALL CC LIST--'+ccRC);
return ccRC;
}
public integer getCCRCsize(){
System.debug('CC SIZE'+ccRC.size());
return ccRC.size();
}
public List<Task> getCallCRC(){
return ccRC;
}

public List<Task> getCallCompletedTC(){
cctc = new List<Task>();
for(Task tk: tList){
if(tk.Type.contains('Call Completed - Team Call')){
cctc.add(tk);
}
}
return cctc;
}
public integer getCCTCsize(){
System.debug('CC SIZE'+cctc.size());
return cctc.size();
}
public List<Task> getCallCTC(){
return ccTC;
}
public List<Task> getCallCompletedAM(){
ccam = new List<Task>();
for(Task tk: tList){
if(tk.Type.contains('Call Completed - with AM')){
ccam.add(tk);
}
}
return ccam;
}
public integer getCCAMsize(){
System.debug('CC SIZE'+ccam.size());
return ccam.size();
}
public List<Task> getCallCAM(){
return ccAM;
}
public List<Task> getCallCompletedO(){
cco = new List<Task>();
for(Task tk: tList){
if(tk.Type.contains('Call Completed - Other')){
cco.add(tk);
}
}
return cco;
}
public integer getCCOsize(){
System.debug('CC SIZE'+cco.size());
return cco.size();
}
public List<Task> getCallCO(){
return ccO;
}
public PageReference callRC(){
System.debug('IN RC');
render1=true;
render2=false;
render3=false;
render4=false;
return null;
}
public PageReference callTC(){
System.debug('IN TC');
render1=false;
render2=true;
render3=false;
render4=false;
return null;
}
public PageReference callAM(){
render1=false;
render2=false;
render3=true;
render4=false;
return null;
}
public PageReference callO(){
render1=false;
render2=false;
render3=false;
render4=true;
return null;
}
}

 

 

 

 

 

Message Edited by witoutme247 on 11-13-2009 03:55 AM

This is something that astounds me. Can someonn tell me if there is a way around?

Requirement: Opportunity Stage is set depending on bunch of 9 other picklist values (basically the rep picks the things that are done, and this in turn feeds/computes the stage).

Problem: Stage is a required field. Record cannot be saved without a value in it. Workflow field update and before triggers do not work.

Simple workaround: Set the default value of the stage on creation to the first stage. BUT this is not possible as stage default value cannot be set!!!!!Only scenario where an opportunity’s stage can be set by default is when doing a lead conversion. 

This is just unbelievable. Help!

PS: I have multiple record types for multple sales process.

Message Edited by witoutme247 on 01-13-2010 04:21 AM

I'm building a task detail page with hover links in the bottom (similar to related list hovers). The difference is these links will display information according to our custom logic.

In this demo, I have two outputtext in the bottom of the detail page, each with actionSupport tags associated with them. The problem is, when I hover over the first text, the action from the second actionsupport executes. Irrespective of the number of outputtext+actionsupport, the action executed is always the last actionsupport tag. I dont understand if I'm missing something. I always end up rerendering the last pageblock again and again.

Please help.

The VF Page

 

<apex:page standardController="Task" sidebar="True" Title="Task:" extensions="HyperTaskDetail" action="{!onload}">
<apex:detail subject="{!task.Id}"/>
<apex:param name="infoid" value="{!task.WhoId}"/>
<apex:form >
<apex:outputPanel >
<table width="950" border="0" cellspacing="0" cellpadding="0">
<tr align="center" valign="top" >
<td height="26" > <u><apex:outputText value="Call Completed - With Relevant Contact [{!ccRCsize}]"/></u>
<apex:actionSupport event="onmouseover" action="{!callRC}" rerender="panel"/>
</td>

<td height="26"> <u><apex:outputText value="Call Completed - Team Call [{!ccTCsize}]"/></u>
<apex:actionSupport event="onmouseover" action="{!callTC}" rerender="panel"/>
</td>

</tr>
</table>
</apex:outputPanel>
</apex:form>
<apex:outputPanel id="panel">
<apex:pageBlock id="block1">
1:{!render1},2:{!render2},3:{!render3},4:{!render4}
<apex:outputPanel id="info1">
<apex:pageBlockTable rendered="{!render1}" value="{!CallCRC}" var="c1"title="Call Completed - With Relevant Contact">
<apex:facet name="caption"><strong>Call Completed - With Relevant Contact</strong></apex:facet>
<apex:column > <apex:facet name="header"> Assigned </apex:facet>{!c1.Owner.Name}</apex:column>
<apex:column > <apex:facet name="header"> Subject </apex:facet>{!c1.Subject}</apex:column>
<apex:column > <apex:facet name="header"> Status </apex:facet>{!c1.Status}</apex:column>
<apex:column > <apex:facet name="header"> Comments </apex:facet> {!c1.Description} </apex:column>
</apex:pageBlockTable>
</apex:outputPanel>
<apex:outputPanel id="info2" >
<apex:pageBlockTable rendered="{!render2}" value="{!CallCTC}" var="c2"title="Call Completed - Team Call">
<apex:facet name="caption"><strong>Call Completed - Team Call</strong></apex:facet>
<apex:column > <apex:facet name="header"> Assigned </apex:facet>{!c2.Owner.Name}</apex:column>
<apex:column > <apex:facet name="header"> Subject </apex:facet>{!c2.Subject}</apex:column>
<apex:column > <apex:facet name="header"> Status </apex:facet>{!c2.Status}</apex:column>
<apex:column > <apex:facet name="header"> Comments </apex:facet> {!c2.Description} </apex:column>
</apex:pageBlockTable>
</apex:outputPanel>

</apex:pageBlock>
</apex:outputPanel>
</apex:page>

 

The extension:

 

public with sharing class HyperTaskDetail {
private final Task t;
public Boolean render1{get; set;}
public Boolean render2{get; set;}
public Boolean render3{get; set;}
public Boolean render4{get; set;}

public HyperTaskDetail(Apexpages.StandardController controller){
this.t = (Task)controller.getRecord();
}
public List<Task> tList = new List<Task>();
public List<Task> ccRC {get; set;}
public List<Task> ccTC {get; set;}
public List<Task> ccAM {get; set;}

public List<Task> ccO {get; set;}
public PageReference onload(){

render1=false;
render2=false;
render3=false;
render4=false;
if(t.WhoId!=null){
tList = new List<Task>();
for(Task tk :[select Id, Owner.Name, WhoId, Status, Subject, Description, Type from Task where WhoId = :t.WhoId]){
tList.add(tk);
}
System.debug('ALL TASK LIST---'+tList);
}
getCallCompletedRC();
getCallCompletedTC();
getCallCompletedAM();
getCallCompletedO();
return null;
}
public List<Task> getCallCompletedRC(){
ccRC = new List<Task>();
for(Task tk: tList){
if(tk.Type.contains('Call Completed - With Relevant Contact')){
ccRC.add(tk);
}
}
System.debug('ALL CC LIST--'+ccRC);
return ccRC;
}
public integer getCCRCsize(){
System.debug('CC SIZE'+ccRC.size());
return ccRC.size();
}
public List<Task> getCallCRC(){
return ccRC;
}

public List<Task> getCallCompletedTC(){
cctc = new List<Task>();
for(Task tk: tList){
if(tk.Type.contains('Call Completed - Team Call')){
cctc.add(tk);
}
}
return cctc;
}
public integer getCCTCsize(){
System.debug('CC SIZE'+cctc.size());
return cctc.size();
}
public List<Task> getCallCTC(){
return ccTC;
}
public List<Task> getCallCompletedAM(){
ccam = new List<Task>();
for(Task tk: tList){
if(tk.Type.contains('Call Completed - with AM')){
ccam.add(tk);
}
}
return ccam;
}
public integer getCCAMsize(){
System.debug('CC SIZE'+ccam.size());
return ccam.size();
}
public List<Task> getCallCAM(){
return ccAM;
}
public List<Task> getCallCompletedO(){
cco = new List<Task>();
for(Task tk: tList){
if(tk.Type.contains('Call Completed - Other')){
cco.add(tk);
}
}
return cco;
}
public integer getCCOsize(){
System.debug('CC SIZE'+cco.size());
return cco.size();
}
public List<Task> getCallCO(){
return ccO;
}
public PageReference callRC(){
System.debug('IN RC');
render1=true;
render2=false;
render3=false;
render4=false;
return null;
}
public PageReference callTC(){
System.debug('IN TC');
render1=false;
render2=true;
render3=false;
render4=false;
return null;
}
public PageReference callAM(){
render1=false;
render2=false;
render3=true;
render4=false;
return null;
}
public PageReference callO(){
render1=false;
render2=false;
render3=false;
render4=true;
return null;
}
}

 

 

 

 

 

Message Edited by witoutme247 on 11-13-2009 03:55 AM