function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

URL Hacking to Prepopulate Fields

I have a custom object with some text fields. I created a custom VF page . I want to prepoulate one of the fields with some value. I refered the URL hacking mentioned here

I created a custom new link button and passing (&00N29000000Jat5=test) the value that I want prepoluated. The issue I'm having is that the field does not prepoulate  when in NEW mode. It does however populate the value in EDIT mode. This tells me that the ID of the field is correct , but not sure wht is going on. 

Just to add to above question . In my VF page I have <apex:inputfield value="{!customObject__c.field__c}" id="field__c"/>
William TranWilliam Tran
Can you post the code?  Why do you need it in the "New" mode? If Edit works, then use it.   Except for the look and feel, it really does not do much.

Hi William,  Thanks  for your reply . 
I have a custom object  PM_Request__c  with a lookup field to contact and a text field.  I need to open a custm VF page  for edit/view/new .  When user clicks new from the related list on the contact page ,   contact field is populated. I want to pre-populate the "requested by" with the name of the person who created the contact. DOnt know how to do it using controler extension. 

Below is what I have as if now
<apex:page standardcontroller="PM_Request__c"><apex:messages />

 <apex:form   >
        <apex:pageBlock mode="new,edit,view" title="Request for PM/Analyst" id="Section1"    >
               <font color="red">[All fields are required]</font>
            <table cellpadding="3" cellspacing="3">
                <tr><td colspan="5">Contact: 
                    <apex:inputfield value="{!PM_Request__c.contact__c}"    />
                <tr><td colspan="5">Requested By:<apex:inputfield value="{!PM_Request__c.Requested_By__c}" /></td></tr>

I use a VF page that came from this post.
Jass Singh 1Jass Singh 1
Thanks for sharing your knowlegde. It's very helpful to all. Check Introduction to Ethical Hacking – Types & Salary of Ethical hacker (