Activity Forums Salesforce® Discussions How to populate values in vf page from formula field?

  • How to populate values in vf page from formula field?

    Posted by Danna on April 29, 2016 at 1:44 PM

    I have created a formula field in lead object with a hyperlink which redirects to a page. I need to send lead last name and email to that page to get pre-filled in that. Formula field is

    IF( AND( Account__r.Id =null, ISPICKVAL(LeadSource,”INTERNET”) ), HYPERLINK(“/apex/Rforce_AccountSearch_Page?caseId=”&Id,IMAGE(“/resource/CreateAccountButton”, “CreateAccount”),”_self”), NULL)
    Please suggest.

    Prakhar replied 10 years ago 2 Members · 1 Reply
  • 1 Reply
  • Prakhar

    Member
    June 13, 2016 at 2:39 PM

    Hii Danna,

    In the VF page that you are using, you will have to assign the value from the url to that particular {get;set;} field of Vf page.

    For Example: Let us suppose your URL looks something like this:

    /apex/Rforce_AccountSearch_Page?caseId=”&Id& “&lastname=” & LastName

    Then use the below code in your VF page:-

    <apex:inputText value=”{!lastname}”>

    Then in Apex:

    String lastName{get;set;}

    and get the parameters from the URL using

    ApexPages.CurrentPage().getParameters.get(‘lastname’);

    and assign the lastname {get;set;} of the page with the above value i.e.

    lastname = ApexPages.CurrentPage().getParameters.get(‘lastname’);

    Hope that resolves your issue.

    Thanks.

Log In to reply.