• MartinK
  • NEWBIE
  • 75 Points
  • Member since 2010

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 7
    Replies

I am working on what is essentially an affiliate marketing application where a user on a third party site (the referrer) clicks a link to our site and our site redirects the user to another third party site (the recipient).  I would like to do this in Salesforce however, The Salesforce Sites URL Redirect rules are too limited for my use case.

 

In my use case on the referrer's website the user clicks on a link to www.myVFpage.com/LinkForwarding?lnk=1234. The Visualforce page looks up the specified link number on the Salesforce Custom Object - Link Manager and gets the recipients URL and then conducts the redirect to the recipients website.

 

The code is as follows:

Visualforce Page LinkForwarding

<apex:page controller="ControllerLinkForwarding" action="{!init}">
</apex:page>

 

 

public class ControllerLinkForwarding {  
  public pagereference init(){
   Link_Manager__c l = [select id, URL__c,Name from Link_Manager__c
       where Name =   
         :ApexPages.currentPage().getParameters().get('link') limit 1];
    PageReference newPage = new pageReference (l.URL__c);
    newPage.setRedirect(true);
    return newPage;
   }
}

 

 

This approach is bad for search engine optimization.  I am looking for an approach that does a 301 redirect. What other ways can I attempt to do this. Any suggestions would be most appreciated. Thanks!

I am developing a Salesforce Sites application that has a requirement for creating a cookie that will persist if the Browser is closed and reopened.  Using the APEX Cookies class it appears that only session cookies are created.  Is this true?  Is there a recommended work-around. 

 

Thank you!  

 

 

I am using the following method to format a DateTime field in the local time zone:

 

 

string reservation =
       string.valueof(op.Reservation_Date__c.format('EEEE, MMMM d, yyyy:  HH:mm z'));

 I refer to the field on my VF page as follows: {!reservation}

In my sandbox this displays the expected result, the date time in the local time zone (EDT). In production the time is displayed incorrectly in GMT. 
To troubleshoot this I then created a new sandbox off of the production instance ( that gave the results in GMT ) The test in the new sandbox yielded  the local timezone being displayed in EDT which is correct.
Two questions:
 1) Are these bugs (Sandbox and Production yielding different results and time formatting not working in Production?)
 2) How do I work around this?
Thank you so much for your help. 

 

I have completed an application that uses the Paypal Adaptive Payments Toolkit.  

I have two pages: one that posts the payment to Paypal and a second that receives confirmation that the payment was approved by the user via Paypal.

 

 The problem that I am having is that once the user approves the payment on the Paypal web page. Paypal displays a page indicating that the payment is complete and pauses for several seconds before returning to Salesforce.  If the user closes the window prior to the page redirect the payment is made but not recorded in Salesforce.

 

Has anyone using the toolkit experienced this problem? Is there a work around? Is there a way to make the redirect from Paypal immediate?

 

Thank you for your help!

 

 

 

 

 

 

I started to implement the Paypal Adaptive Payments Toolkit. I had it running great in my sandbox... I started running test cases on it and had to make some minor adjustments.  Now when I make a Pay request from the toolkit. during the Callout I receive the following error.  You have uncommitted work pending. Please commit or rollback before calling out.  The exception is thrown after the HTTP Request is created by the PPHttpUtil  and the System.Http.send method invoked. 

 

Is anyone familar with this particular error?  

 

Thank you!!!

My common parameters and API credentials are all valid.For grins here is my PayRequest ActionType=Pay, CancelUrl=https://cs7.salesforce.com/Invoice?Id=006M0000001fKhBIAU&MainMessage=cancel, ClientDetails=PPClientDetails:[ApplicationId=Paypal1, CustomerId=, CustomerType=, DeviceId=, GeoLocation=, IpAddress=96.242.149.48, Model=, PartnerName=], CurrencyCode=USD, FeesPayer=EACHRECEIVER, FundingtypeList=(), IpnNotificationUrl=, LogDefaultShippingAddress=false, Memo=PayApiTest, PPRequest.ApiName=Pay, PPRequest.RequestEnvelope=PPRequestEnvelope:[DetailLevelCode=ReturnAll, ErrorLanguage=en_US], Pin=, PreapprovalKey=, ReceiverList=(PPReceiver:[Amount=210.00, Email=m2_1298923492_biz@my.com, InvoiceId=W-00002, PaymentSubType=null, PaymentType=, Phone=null, Primary=null]), ReturnUrl=https://cs7.salesforce.com/InvoicePayment?Id=a01M0000000atJ1IAI, ReverseAllParallelPaymentsOnError=false, SenderEmail=null, TrackingId=]
Hello, I have a very simple VF Page that displays an opportunity and the opportunity line items. It works great when run within Salesforce, but when run on a public site the opportunity line items do not show up.  I have checked the public access settings and do not see Opportunity Line Items as standard object that I can grant permissions to.  Is this implied since I have granted permissions on the Opportunity? Are public sites able to display opportunity products?  Any suggestions on how to trobleshoot this.  A simplified version of the VF page is below.   Thank you so much for your help!
<apex:page standardController="Opportunity">
 <apex:pageBlock >
 <apex:pageBlockSection columns="2" >
 <apex:outputField value="{!Opportunity.name}"/>
 </apex:pageBlockSection>
 
 <apex:pageBlockSection >
    <apex:pageBlockTable value="{!Opportunity.OpportunityLineItems}" var="item">
            <apex:column value="{!item.Description}"/> 
        </apex:pageBlockTable> 
  </apex:pageBlockSection>
 </apex:pageBlock> 

Hello,

 

I have a question regarding buttons in Visualforce.   I have an HTML button on a Visualforce page within a row in a page block table.  The code for the button is as follows

 

 

<FORM METHOD="LINK"
   ACTION= "https://na3.salesforce.com/a00/e?CF00N500000020AwV={!Request__c.name}  &CF00N500000020Ax9={!p.Account__r.name}">
   <INPUT TYPE="submit" VALUE="Select Refferal"/>
</FORM>

 

When the page is rendered and I inspect the element the URL reads as follows

 

<form action="https://na3.salesforce.com/a00/e?CF00N500000020AwV=bub&CF00N500000020Ax9=Houses" method="link"><input type="submit" value="Select Refferal"></form>

 I can cut and paste this URL into my browser and the new page is properly launched.

 

However, when I click on the button in the Visualforce page, I am sent to the following URL with the Query string parameters missing.

https://na3.salesforce.com/a00/e?

 

Why do the query string parameters get dropped? What can I do about it.

 

Thank you in advance for your help.

 

 

  • September 19, 2010
  • Like
  • 0

I am using the following method to format a DateTime field in the local time zone:

 

 

string reservation =
       string.valueof(op.Reservation_Date__c.format('EEEE, MMMM d, yyyy:  HH:mm z'));

 I refer to the field on my VF page as follows: {!reservation}

In my sandbox this displays the expected result, the date time in the local time zone (EDT). In production the time is displayed incorrectly in GMT. 
To troubleshoot this I then created a new sandbox off of the production instance ( that gave the results in GMT ) The test in the new sandbox yielded  the local timezone being displayed in EDT which is correct.
Two questions:
 1) Are these bugs (Sandbox and Production yielding different results and time formatting not working in Production?)
 2) How do I work around this?
Thank you so much for your help. 

 

I have completed an application that uses the Paypal Adaptive Payments Toolkit.  

I have two pages: one that posts the payment to Paypal and a second that receives confirmation that the payment was approved by the user via Paypal.

 

 The problem that I am having is that once the user approves the payment on the Paypal web page. Paypal displays a page indicating that the payment is complete and pauses for several seconds before returning to Salesforce.  If the user closes the window prior to the page redirect the payment is made but not recorded in Salesforce.

 

Has anyone using the toolkit experienced this problem? Is there a work around? Is there a way to make the redirect from Paypal immediate?

 

Thank you for your help!

 

 

 

 

 

 

I started to implement the Paypal Adaptive Payments Toolkit. I had it running great in my sandbox... I started running test cases on it and had to make some minor adjustments.  Now when I make a Pay request from the toolkit. during the Callout I receive the following error.  You have uncommitted work pending. Please commit or rollback before calling out.  The exception is thrown after the HTTP Request is created by the PPHttpUtil  and the System.Http.send method invoked. 

 

Is anyone familar with this particular error?  

 

Thank you!!!

My common parameters and API credentials are all valid.For grins here is my PayRequest ActionType=Pay, CancelUrl=https://cs7.salesforce.com/Invoice?Id=006M0000001fKhBIAU&MainMessage=cancel, ClientDetails=PPClientDetails:[ApplicationId=Paypal1, CustomerId=, CustomerType=, DeviceId=, GeoLocation=, IpAddress=96.242.149.48, Model=, PartnerName=], CurrencyCode=USD, FeesPayer=EACHRECEIVER, FundingtypeList=(), IpnNotificationUrl=, LogDefaultShippingAddress=false, Memo=PayApiTest, PPRequest.ApiName=Pay, PPRequest.RequestEnvelope=PPRequestEnvelope:[DetailLevelCode=ReturnAll, ErrorLanguage=en_US], Pin=, PreapprovalKey=, ReceiverList=(PPReceiver:[Amount=210.00, Email=m2_1298923492_biz@my.com, InvoiceId=W-00002, PaymentSubType=null, PaymentType=, Phone=null, Primary=null]), ReturnUrl=https://cs7.salesforce.com/InvoicePayment?Id=a01M0000000atJ1IAI, ReverseAllParallelPaymentsOnError=false, SenderEmail=null, TrackingId=]
Hello, I have a very simple VF Page that displays an opportunity and the opportunity line items. It works great when run within Salesforce, but when run on a public site the opportunity line items do not show up.  I have checked the public access settings and do not see Opportunity Line Items as standard object that I can grant permissions to.  Is this implied since I have granted permissions on the Opportunity? Are public sites able to display opportunity products?  Any suggestions on how to trobleshoot this.  A simplified version of the VF page is below.   Thank you so much for your help!
<apex:page standardController="Opportunity">
 <apex:pageBlock >
 <apex:pageBlockSection columns="2" >
 <apex:outputField value="{!Opportunity.name}"/>
 </apex:pageBlockSection>
 
 <apex:pageBlockSection >
    <apex:pageBlockTable value="{!Opportunity.OpportunityLineItems}" var="item">
            <apex:column value="{!item.Description}"/> 
        </apex:pageBlockTable> 
  </apex:pageBlockSection>
 </apex:pageBlock> 

Hello,

 

I have a question regarding buttons in Visualforce.   I have an HTML button on a Visualforce page within a row in a page block table.  The code for the button is as follows

 

 

<FORM METHOD="LINK"
   ACTION= "https://na3.salesforce.com/a00/e?CF00N500000020AwV={!Request__c.name}  &CF00N500000020Ax9={!p.Account__r.name}">
   <INPUT TYPE="submit" VALUE="Select Refferal"/>
</FORM>

 

When the page is rendered and I inspect the element the URL reads as follows

 

<form action="https://na3.salesforce.com/a00/e?CF00N500000020AwV=bub&CF00N500000020Ax9=Houses" method="link"><input type="submit" value="Select Refferal"></form>

 I can cut and paste this URL into my browser and the new page is properly launched.

 

However, when I click on the button in the Visualforce page, I am sent to the following URL with the Query string parameters missing.

https://na3.salesforce.com/a00/e?

 

Why do the query string parameters get dropped? What can I do about it.

 

Thank you in advance for your help.

 

 

  • September 19, 2010
  • Like
  • 0