I have overridden the 'New' button on Leads page to auto populate 'Owner' field for a specific business process that happens later. This works well in browser but not in the Salesforce1 App.we using "Professional Edition" Is there any reason for it?

Note:I checked also "Available for Salesforce mobile apps and Lightning Pages"

Please advise on this.

<apex:page standardController="Lead">

<script language="JavaScript1.2" src="/js/functions.js"></script>
<script src="/soap/ajax/9.0/connection.js" type="text/javascript"></script>
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script>

<script id="clientEventHandlersJS" language="javascript">
sforce.connection.sessionId = '{!$Api.Session_ID}';

var fname = '{!JSENCODE($User.FirstName)}';
var lname = '{!JSENCODE($User.lastName)}';
var name = fname+' '+lname;

if( (sforce.one != 'undefined') && (sforce.one != undefined) ) {
 else {
     window.top.location.href = '/00Q/e?lea21=1&nooverride=1&retURL=%2F00Q%2Fo&CF00N28000008YR6L_lkid='+window.UserContext.userId+'&CF00N28000008YR6L='+name+''; 

4 Answers 4


field auto populate or URL hack does not work in Salesforce one and Lightning as well.

You need to create custom page and then populate the fields. There is no way to pass parameters to standard pages in Salesforce1 with the sforce.one.createRecord method.

Only way would be to use the sforce.one.navigateToURL method and use a custom Visualforce page for the new record. You can pass parameters as needed to a Visualforce page.

Now we can prepopulate field. FOr more details check @Uwe Heim's answer.

    FirstName : "John",
    LastName : "Doe",  
  • 1
    As of Summer'17 you can add default values now if you page is API v40.0+
    – Uwe Heim
    Aug 28, 2017 at 18:26

As per the previous answer, URL hacks and onclick JavaScript buttons don't work in Salesforce1.

An alternative to Visualforce in this case could be to use a Global Action to create the lead, AFAIK this works fine in Professional Edition. Using an action, you can create a layout just for that type of lead (excluding any fields that are irrelevant for that type) and can use formulas to set predefined values for any fields, including the owner field.


SF1 Lead Record Type overriding standard new button

I've had similar issues by overriding the standard new button. As you can see, the SF1 styling is not there, and when i click on continue, it dumps me into the classic desktop page layout.


Plain and simple, you can use it like this one-liner:

    FirstName : "John",
    LastName : "Doe",  

From the Summer '17 Release Notes - Prepopulate Fields on a Record Create Panel

Speed up record creation with prepopulated field values. The sforce.one.createRecord function now includes defaultFieldValues (optional) so you can define fields on a record create panel, including fields not displayed on the panel. This change applies to Lightning Experience and the Salesforce1 mobile browser app.

Users must have create access to prepopulated fields. Errors during saving that are caused by field access limitations do not display error messages.

Caution 1:

The this feature from Summer'17 works only if you put your Visualforce Page to API v40.0 or higher.

Caution 2:

Objectnames and Fieldnames are CASE-SENSITiVE! So lastname is not LastName and only LastName is correct

See also:



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .