Skip to main content
I have now edited my code, however it still does not display anything.
Source Link
Lily
  • 1.4k
  • 11
  • 41
  • 76

I am having problems with the my visualforce page displaying the data from my SOQL query.

This is my controller:

public with sharing class fetchCaseCallsController {
 
private Id accountId;
public List<Task> caseCalls {get;set;}

public fetchCaseCallsController(ApexPages.StandardController sc) {
    accountId = sc.getId();
    caseCalls = new List<Task>();
}

public Task[] getCaseCallsgetTasks() {
    if (accountId != null) {
        return caseCalls = [
                select Id, Subject
                from Task
                where WhatId in (select Id from Case where AccountId = :accountId)
                and Type = 'Call'
                ];
    } else {
        return new Task[] {};
        }
  

   }
}

Basically in the controller I am querying all calls that were made against a case for a specific account.

My VF page looks as follows:

       <apex:page standardController="Account" extensions="fetchCaseCallsController"> 

  <h1>Logged calls against cases</h1>
  <table>
  <apex:repeat value="{!caseCallstasks}" var="act">
    <tr>
      <td>This is the subject {!act.Subject}</td>
    </tr>
  </apex:repeat>
  </table>
  
</apex:page>

I don't really understand why nothing is displayed on my page? Tia.

I am having problems with the my visualforce page displaying the data from my SOQL query.

This is my controller:

public with sharing class fetchCaseCallsController {
 
private Id accountId;
public List<Task> caseCalls {get;set;}

public fetchCaseCallsController(ApexPages.StandardController sc) {
    accountId = sc.getId();
    caseCalls = new List<Task>();
}

public Task[] getCaseCalls() {
    if (accountId != null) {
        return caseCalls = [
                select Id, Subject
                from Task
                where WhatId in (select Id from Case where AccountId = :accountId)
                and Type = 'Call'
                ];
    } else {
        return new Task[] {};
        }
    }
}

Basically in the controller I am querying all calls that were made against a case for a specific account.

My VF page looks as follows:

    <apex:page standardController="Account" extensions="fetchCaseCallsController">
<h1>Logged calls against cases</h1>
  <table>
  <apex:repeat value="{!caseCalls}" var="act">
    <tr>
      <td>This is the subject {!act.Subject}</td>
    </tr>
  </apex:repeat>
</table>
  
</apex:page>

I don't really understand why nothing is displayed on my page? Tia.

I am having problems with the my visualforce page displaying the data from my SOQL query.

This is my controller:

public with sharing class fetchCaseCallsController {
private Id accountId;
public fetchCaseCallsController(ApexPages.StandardController sc) {
    accountId = sc.getId();
}

public Task[] getTasks() {
    if (accountId != null) {
        return [
                select Id, Subject
                from Task
                where WhatId in (select Id from Case where AccountId = :accountId)
                and Type = 'Call'
                ];
    } else {
        return new Task[] {};
    }
 

   }
}

Basically in the controller I am querying all calls that were made against a case for a specific account.

My VF page looks as follows:

       <apex:page standardController="Account" extensions="fetchCaseCallsController"> 

  <h1>Logged calls against cases</h1>
  <table>
  <apex:repeat value="{!tasks}" var="act">
    <tr>
      <td>This is the subject {!act.Subject}</td>
    </tr>
  </apex:repeat>
  </table>

</apex:page>

I don't really understand why nothing is displayed on my page? Tia.

Source Link
Lily
  • 1.4k
  • 11
  • 41
  • 76

Problem displaying query data on Visualforce page

I am having problems with the my visualforce page displaying the data from my SOQL query.

This is my controller:

public with sharing class fetchCaseCallsController {

private Id accountId;
public List<Task> caseCalls {get;set;}

public fetchCaseCallsController(ApexPages.StandardController sc) {
    accountId = sc.getId();
    caseCalls = new List<Task>();
}

public Task[] getCaseCalls() {
    if (accountId != null) {
        return caseCalls = [
                select Id, Subject
                from Task
                where WhatId in (select Id from Case where AccountId = :accountId)
                and Type = 'Call'
                ];
    } else {
        return new Task[] {};
        }
    }
}

Basically in the controller I am querying all calls that were made against a case for a specific account.

My VF page looks as follows:

    <apex:page standardController="Account" extensions="fetchCaseCallsController">
<h1>Logged calls against cases</h1>
  <table>
  <apex:repeat value="{!caseCalls}" var="act">
    <tr>
      <td>This is the subject {!act.Subject}</td>
    </tr>
  </apex:repeat>
</table>
  
</apex:page>

I don't really understand why nothing is displayed on my page? Tia.