• Chris Brasch
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi all,

I have created a lead flow where the Finish Location is a pageReference ( for a new lead) contructed from parameters (flow variables) collected throughout the flow. I am experiencing a problem when attempting to constuct the URL where the variables contain spaces, such as "Street". I want to encode the variables gathered from the flow, using the URLEncode Utility class, so that when the URL is constructed in the appropriate format. My code is below...



public class ExistingCustomerLead {

public Flow.Interview.Existing_Customer_Lead_Search myFlow {get; set;}
    public String ExistingCustomer;
    public String getExistingCustomer() {
    if (myFlow==null) return '';
else return myFlow.ExistingCustomer;
    }
    public String City;
    public String getCity() {
        if (myFlow==null) return '';
        else return myFlow.City;
    }
    public String Country;
    public String getCountry() {
        if (myFlow==null) return '';
        else return myFlow.Country;
    }
    public String State;
    public String getState() {
        if (myFlow==null) return '';
        else return myFlow.State;
    }
    public String Street;
    public String getStreet() {
        if (myFlow==null) return '';
        else return myFlow.Street;
    }
  
   
    public String PostalCode;
    public String getPostalCode() {
        if (myFlow==null) return '';
        else return myFlow.PostalCode;
    }

    public PageReference getFinishPage(){

        PageReference p = new PageReference('/00Q/e?CF00N90000001AYrf' + EncodingUtil.urlEncode(getExistingCustomer(), 'UTF-8') + '&RecordType=012900000007FVZ&ent=Lead');
                p.setRedirect(true);
                   
                    return p;
       
    }



}