Posts

Showing posts from November, 2011

Pre-Populate fields on button/Link

Many times we need to pre-populate some field while creating/updating a record on button/Link click. It may be on custom visualforce page or standard layout. 1) Prepopulating Text, Number fields on Standard Pagelayout: / Var1 /e?CF Var2 = Var3 &retURL=%2F Var4 Var1=3 char code of object (i.e Account=001, Contact=003 for Custom/Other object click on Object                                                     Tab to get unless object Tab is not override) Var2=SFDC Id of the field need to pre-populate. Var3=Value need to populate (may be hard coded or variable per requirement i.e {!Account.Name}) Var4= URL need to redirect after record Save. e.g  /00T/e?CF00NA0000005pr8F=1&retURL=%2F{!Lead.Id} 2) Prepopulating Lookup fields  on Standard Pagelayout: for Lookup prepopulate we need to map field Id and Name both. e.g.  /003/e?CF00NA0000003KWvS_lkid={!Contact.Id}&CF00NA0000003KWvS={!Contact.Name} 3) Prepopulating Lookup fields  on Visualforce Page: /apex/ Your

field set in visualforce page