- Home
- Technical Library
- Boards
- Cookbook
- Code Share
- Blogs
- Partners
-
More
-
Services
- Training & Certification
- Support
-
Galleries
- Force.com Sites Gallery
- Chatter Challenge Entries
-
Other Web Sites
- Salesforce.com
- Database.com
- AppExchange
- CRM Community
-
Discussions
- Announcements
- General Development
- Schema Development
- New to Cloud Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules Discussion
- Security
- Mobile
- Force.com Sites
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby Development
- Adobe Flash Builder for Force.com
- Desktop Integration
- REST API Integration
- Streaming API
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- Excel Connector
- AJAX Toolkit & S-controls
- Force.com Builder & Native Apps
- AppExchange Directory & Packaging
- Force.com Labs Projects
- Open Source
- Site.com
- Jobs Board - Administrators
- Jobs Board - Developers
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Force.com Sites
- :
- Re: passing record id
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
passing record id
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-24-2012 03:19 PM
I have created a HTML email template that gets triggerd when a record is sent for Approval. Within this email template I have a link 'Approve/Reject' which takes the Approver to the Force Site wherein the landing page is a visualforce page.
The visualforce page loads correctly but without any data.
How can I get the correct record to load? (This page displays the record details when tested outside of Force Site. )
extension class
public class JobApp {
public Id posId {get;set;}
private final Position__c pos;
public JobApp(ApexPages.StandardController controller)
{
posId = controller.getRecord().Id;
}
public PageReference saveAndReject() {
PageReference requestPage = new pagereference('https://na9.salesforce.com/'+posid);
requestPage.setRedirect(true);
return requestPage;
}
}
VisualForcePage
<apex:page standardController="Position__c" extensions="JobApp" showHeader="false" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:sectionHeader title="Position Detail Page" />
</apex:pageBlockSection> <br/>
<b>
<apex:OutputLabel value="Your approval has been requested for the following New Position.">
</apex:OutputLabel>
</b>
Position Record: {!Position__c.Name} <br/><br/>
Status: {!Position__c.Status__c} <br/><br/>
Location: {!Position__c.Location__c}<br/><br/>
Functional Area: {!Position__c.Functional_Area__c}<br/><br/>
Job Level: {!Position__c.Job_Level__c}<br/><br/>
Minimum Salary: {!Position__c.Min_Pay__c}
Maximum Salary: {!Position__c.Max_Pay__c}
<br/><br/><br/><br/><br/><br/>
<apex:OutputLabel value="Please Click the appropriate button below to approve or reject the request.">
</apex:OutputLabel> <br/><br/>
<apex:commandButton action="{!saveAndReject}" styleClass="buttonStyle" style="vertical-align:left;width:80px;height:20px; background:green;" value="Approve" />
<apex:commandButton styleClass="buttonStyle" style="vertical-align:left;width:80px;height:20px; background:red;" value="Reject" />
<br/><br/>
</apex:pageBlock>
</apex:form>
</apex:page>
Solved! Go to Solution.
Re: passing record id
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-24-2012 11:58 PM
Check the site guest user profile access for ur custom object...
Make sure that it has sufficient permission.
SFDC Consultant & Software Engineer & Mathematician
Re: passing record id
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-25-2012 06:14 AM
Erkan, thanks for your response.
I have the required permissions for the guest user profile. I will check again though.
Re: passing record id
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-10-2012 08:23 AM
Sorry for the late response. But I got this working (with th help of Salesforce Support). All I had to do was, in the link, pass the recordid. As in
http://rov.universal.na9.force.com/VFP/{!customobj
where !customobject__c.Id = recordid

