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

Field prepopulation of 'New' page

Is there a recommended way of pre-populating fields on the 'New' form?  For instance, let's say we want to show the user a New Case page where one custom field we've added is default set to a particular string.

I know about a non-recommended, undocumented way of doing it, and I can see that many AppExchange packages also know about this.  (ie, adding CF00012000000abcde=text to the URL)  But we've had some problems with it and would like to find an alternative.

Considered:  'fake' Visual Force New form that emulates the real one, but with the pre-population.  Problem is that, for Case at least, multiple page layouts will exist and this info is not fully exposed by the new Apex metadata classes.

Also considered:  generate a new object programmatically, setting the field in a trigger, and then show the user an edit page for the new record.  Problem is that this means all the assignment rules, triggers, workflow, etc., will run before correct info is available.

Any other ideas?  This is such a common request; there must be a better solution.



Did you find a solution for this? We have the same requirement too.


We need to pre-populate fields on a 'new' record, show the standard Salesforce page layout for the record, and the let the user save. Sadly ApexPages.standardController(SObject) supports only view, edit & delete. Any ideas?







I have a similar requirement. Please let me know if any of you found any solution.