You need to sign in to do that
Don't have an account?

sforce.one.editRecord throws an Uncaught SyntaxError: Unexpected token ILLEGAL
Can't seem to get sforce.one.editRecord to work.... anyone have any thoughts as to what I can try? Litterly just passing it the id in the standard controller.
<script>
sforce.one.editRecord('{!Order.Id}');
</script>
above method should work and i used to write the code in the below option1 to do more validation which is similar to your code.
Option 1
var orderid= '{!Order.Id}';
or
Option 2 ( for test case)
var orderid = '018sN0000000DScL'(some order record id )
sforce.one.editRecord(orderid);
Hope this will be helpful. Here i'm just passing the hard-coded id value instead of that pass the dynamic id. '{!Order.Id}'. I think you should specify the script type in your code.
<script type="text/javascript">
if( (typeof sforce.one != 'undefined') && (sforce.one != null) )
{
sforce.one.editRecord('{!Order.Id}');
}
</script>
The below script is working for me.
Far as I can tell, there is no way to actually open a record for edit. Which seems a bit ridiculous.
Can you please enlight us with a simple example / explanation?
I would like to redirect to the detault SF1 edit.
I overriden the edit with a direction page that in turn decide to wich page to redirct etc.
Many thanks.