1

I am trying to redirect to specific record type's edit page layout of an object. Redirection works in Full salesforce site but not in Salesforce1. I tried below function to redirect the page in Salesforce1. But it doesn't work, it always displays default record type's edit page layout of the object

sforce.one.navigateToURL("/006/e?RecordType=01280000000UIuJ&nooverride=1",true);

I tried redirecting the page by below way.Redirection happens in Salesforce1 but it displays the page of full salesforce site. Please advise how to achieve this

window.location.href="/006/e?RecordType=01280000000UIuJ&nooverride=1";
1
  • I can use sforce.one.createrecord function to achieve the same.But I would like to pass default values to fields as url parameters and createrecord doesn't support the same
    – Mikey
    Commented Jun 22, 2015 at 13:04

2 Answers 2

1

Try the createRecord method instead:

sforce.one.createRecord('Opportunity', '01280000000UIuJ');

Documentation:

createRecord(​entityName​[, recordTypeId])

Opens the page to create a new record for the specified entityName, for example, “Account” or “MyObject__c”.

recordTypeId is optional and, if provided, specifies the record type for the created object.

0

This is how I am using to redirect in SF1 and it works absolutely fine. Do you think, your process is similar?

$("#selector").click(function(){
toUrl('/006/e?RecordType=01280000000UIuJ&nooverride=1');
}



function toUrl(url){
 if(typeof sforce == 'undefined') 
   window.location.href = url;
 else
   sforce.one.navigateToURL(url);
}
1
  • I too tried the same. Page layout displays but that is not the one associated with record type I mentioned in the URL(01280000000UIuJ in mycase). It is the page layout of default record type of the user. Did you make sure that the record type you are using in the URL is not the default record type of the user?
    – Mikey
    Commented Jun 22, 2015 at 4:18

You must log in to answer this question.

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