I have a simple redirect link that goes through a visual force page that works perfectly fine except for non-administrative users the redirect url does not include the parameter it needs to build the report. I'm not aware of permission issues here so I'm not sure what the problem is here.
Have a formula field that builds a hyperlink like so:
HYPERLINK('/apex/VF_Page?Id=' + Main_Account_Id__c, 'Efforts')
Then the visual force page builds a new report URL passing the parameter from the controller:
<apex:page controller="ControllerAccountFieldsbyId" >
<div style="margin: 10% auto; text-align: center;">
<h4>Please wait while your report is being prepared...</h4><br/>
<apex:image url="{!$Resource.Loading_Bar}" width="400" height="50"/>
<script> window.top.location = window.location.protocol+"//"+window.location.host+'/00Od0000003jq9l?pv0={!account.Related_Accounts__c}'</script>
^ THIS IS THE REDIRECT URL REPORT ID ^ ^ MISSING PARAMETER FOR NON-ADMIN USER
</div>
</apex:page>
This builds a URL like so:
https://na14.salesforce.com/{report_id}?pv0={**missing_id**}
Here is the controller class:
public with sharing class ControllerAccountFieldsbyId {
public Account getAccount() {
if(!string.isEmpty(ApexPages.currentPage().getParameters().get('Id'))){
return [
SELECT Id, ID__c, Main_Account_Id__c, Name, Related_Accounts__c FROM Account
WHERE Id = :ApexPages.currentPage().getParameters().get('Id')];
} else {
return new Account();
}
}
}
Again this works just fine AS IS for admin users, the only issue is when a non-admin user clicks the link they are redirected without the account ID that is supplied from the controller.