2

I am using sforce.one.createRecord() on a visualforce page. The visualforce page is then used as the override on the New button for a custom object. This works fine, except that I need to redirect the user off the visualforce page when they click Cancel. Is there any way to do this?

Alternatively, now that lightning components can be used to override standard buttons, is there any way to do the same kind of thing, via firing the force:createRecord event and then detecting an event when user clicks Cancel?

  • Are you open to creating your own custom component? – Rao May 31 '17 at 21:11
  • Yes, but trying to keep it simple, so that the same process can support several custom objects, all with record types. That might end up being how we go, but trying to avoid it. – sarakg Jun 1 '17 at 0:26
1

No, this seems currently not possible, since it is not officially stated in the documentation.

https://developer.salesforce.com/docs/atlas.en-us.salesforce1.meta/salesforce1/salesforce1_dev_jsapi_sforce_one.htm

https://developer.salesforce.com/docs/atlas.en-us.208.0.lightning.meta/lightning/ref_force_createRecord.htm

Per default it routes to the newly generated object, which is often NOT what we need. We can only hope, that Salesforce recognizes the severe necessity for us to get control on where the users end up after the insert. For many use cases I need to create child records and navigate to the parent. Not possible now :-(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.