2

The below VF page queries for a list of tasks assigned to a certain custom record. It works perfectly fine (shows 3 Tasks) when accessed by an internal user (/apex/siteTasks?id=xxx) while it does not show any data when the same page is accessed through Force.com Site. I have checked the usual suspects like CRUD, FLS, VF page access to the Site profile. Debug logs on the site user shows that the query in the Apex Class is returning data but the VF does not show it. Thanks in adv!

VF Page

<apex:page standardController="Cust__c" extensions="siteTasks">
<apex:pageBlock title="Tasks">
    <apex:pageBlockTable value="{!Tasks}" var="tsk">
        <apex:column title="Subject" value="{!tsk.Subject}" />
        <apex:column title="Status" value="{!tsk.Status}" />
    </apex:pageBlockTable>
</apex:pageBlock>

Extension

public class siteTasks {

  public Cust__c inc {get; set;}
  public List<Task> Tasks {get; set;}

  public siteTasks(ApexPages.StandardController ctrl) {
    cust = (Cust__c) ctrl.getRecord();

    Tasks = [SELECT ID, Type, Subject, Status
                FROM Task
                WHERE WhatId =: cust.id];
  }
}
1
  • @eyescream, any thoughts on this?
    – DCBoy
    Mar 24 '14 at 16:35
1

By default, Organization-Wide Defaults (OWD) for Activities (the collective name for Tasks and Events) are set to 'Private', so no user (except for a System Administrator, who has 'View All Data' permission) should be able to see any other user's Tasks, except via the role hierarchy (manager can see their underlings' tasks).

You could try sharing the Task records with the Site guest user, though I'm not sure if this is even possible, otherwise, you'll need to set OWD for Activities to Public Read Only.

0

does the site user have permission to the Cust__c object, any fields, and access to the activities and its fields?

When stuff in VF is blank, but you don't get the login page, that usually means, "You've got object permissions so that page loads, but I'm going to hide the fields from you"

Can you try displaying some information on the page about the cust__c? That at least proves the permisssions aren't the issue.

1
  • I am able to see fields from Cust__c object on the VF page. I also double checked the FLS on Task object for the site profile and all the fields are visible.
    – DCBoy
    Mar 24 '14 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.