• dizon
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

One of my classes are acting quite strangely and not retrieving all fields depending on the profile that is currently running the apex. However, AFAIK - profiles should not affect the retrieval of fields as apex is executed in system mode. On further inspection and use of debug logs, it seems that my system administrator profile can return all fields (as expected), however when changing to the Human Resources profile, it can retrieve 1 lookup field, however the rest can not be seen.

After checking field level security, all the object's fields are visible to the profile.

If anyone can shed some light on this issue, that would be great.

 

Here are snippets from the debug log:

11:03:19.206|SOQL_EXECUTE_BEGIN|[155,49]|Aggregations:2| SELECT ID,
Name,
Approval_Status__c,
Employee__c,
Employee__r.Name,
Managers_Manager__c,
Manager_On_Leave__c,
Employee__r.Leave_Manager__c,
Employee__r.Leave_Manager__r.User__c,
Employee__r.Timesheet_Manager__r.User__c,
Employee__r.Employee_ID__c,
Employee__r.Timesheet_Manager__c,
Manager__c,
End_Date__c,
Start_Date__c,
Total_Hours__c,
Payslip__c,
BASEURL__c,
Reference__c,
(SELECT ID,
Name,
Comments__c,
Timesheet__c,
Project__c,
Task__r.Name,
Project__r.Name,
Task__c
FROM Timesheet_Items__r
ORDER BY Name ASC),
(SELECT ID,
Date__c,
Hours__c,
Timesheet_Item__c,
Timesheet__c
FROM Timesheet_Entries__r)
FROM Timesheet__c
WHERE Approval_Status__c =: classGlobalVariables.LBL_APPROVED
AND Managers_Manager__c =: UserInfo.getUserId()
ORDER BY Name
11:03:19.211|METHOD_ENTRY|[192,42]|UserInfo.getUserId()

 

11:03:19.223|USER_DEBUG|[602,5]|DEBUG|########TIMESHEET######## SHRM__Timesheet__c:{SHRM__Manager__c=00580000003I3NgAAK, Name=TS-0542, SHRM__Approval_Status__c=Approved, SHRM__Start_Date__c=2009-12-18 00:00:00, SHRM__Manager_on_Leave__c=false, SHRM__baseURL__c=https://shrm.na6.visual.force.com, SHRM__Total_Hours__c=14.000, Id=a0B80000005cxiREAQ, SHRM__End_Date__c=2009-12-18 00:00:00}

 Manager__c as you can see is a lookup field, however the other lookupfields (e.g. my Employee__c  field) is not returned, though it is queried in my soql. 

 

 

However, same method, but sys admin profile:

 

11:06:37.831|USER_DEBUG|[602,5]|DEBUG|########TIMESHEET######## SHRM__Timesheet__c:{SHRM__Approval_Status__c=Approved, SHRM__Start_Date__c=2010-02-11 00:00:00, SHRM__Total_Hours__c=6.000, SHRM__End_Date__c=2010-02-17 00:00:00, Name=TS-0936, SHRM__Manager__c=00580000003HmenAAC, SHRM__Employee__c=a0380000007Rd9AAAS, SHRM__Manager_on_Leave__c=false, SHRM__baseURL__c=https://shrm.na6.visual.force.com, Id=a0B80000006c3lNEAQ}

 

... seems to retrieve all fields.

 

Regards,

David Dizon

  • February 17, 2010
  • Like
  • 0

I understand that in a custom visualforce page, the help attribute in a sectionHeader tag can reference a Static Resource (in my case a .pdf file). Can this functionality be mirrored in a standard salesforce tab?

 

e.g. 

<apex:sectionHeader title="Custom Account View/Edit" subtitle="{!Account.name}" help="{!$Resource.HelpFile}">

 

Message Edited by dizon on 01-07-2010 09:43 PM
  • January 08, 2010
  • Like
  • 0