+ Start a Discussion

Pre populating a Look up field on the Custom VF page

Hi Developer Forums, Need a few pointer

         My problem: I have two VF pages VF1 and VF2, The VF1 page is an inline page on a standard object detail page(Its need less to say that there is an object relation b/w standard object) and then this VF1 page has a Create new record button which navigate to VF2, On this VF2 I have have a look up field I would like to pre-populate since the action was made form the standard object detail page. This VF2 is a pop up page, Since  this is a pop up, I will have to do it in JS and then I used the Name and ID of the field passed in url, then used Jquery on the VF2 page to place the value on page load using the below.


I have passed the Varibale form class to JS==> ClientName

Any pointers would be much appreciated thanks

.html will set the  HTML contents of the lookupinput - I would have thought you want to use .val, which sets the value of a form field
HI Bob, Thanks for the reply, I steered of this for a bit, I forgot to mention I was using the field set on the VF page so I am not able to give the <apex:tag id="idName">

The field I want to populate is a lookup field on a VF page