I have a overriden "New Event" button which points users to custom Visualforce page instead of standard page. It works in Salesforce.com web application. However, this does not work in Salesforce1 app.
If I click "+" button from calendar in Salesforce1 app, I am redirected to standard "New Event" page. Looks like the button is not overriden.
Where to customize the action of "+" (New Event) button for Salesforce1 app?
Best Answer
This is one of the limitations of overriding buttons. Currently, the button override feature only works in the Salesforce desktop browser UI.
Basically, Visualforce is only surface through the Salesforce1 mobile app in the following ways:
But for the purposes of creating a new record, I think the best possible work around is using a publisher action instead. In this case, your publisher action can launch a Visualforce page. The important things here though, are to give your users the ability to interact with the Cancel/Submit buttons surfaced for publisher actions.
I built a page last year to focus on just this problem. If you take a look at it, the important bits are:
Attaching the event handler looks like this, and is on line 155 of my example:
Then, at some point, you'll have a callback that, when successful, you'll want to make the publisher button active. This bit of code, on line 122 of my example, is well documented:
Finally, the lifecycle handling of the publisher UI. You have to fire the event that says, "go away, I'm done with you." In my case, I do it in the callback for a JS remoting call that is invoked by the function I attached to the submit event handler above in the first step. This is on line 134 of the example and looks like this:
I confess this example has a bit of a cobbled-together feel to it. And there are certain use cases I didn't handle, for instance, this publisher VF page saves at three different times and doesn't handle the potential need to roll-back if one of the later actions goes wrong! But my point in building it was just to focus and study the interaction with the publisher UI from the VF context. At the time I built if I found that the ingredients were kind of all over the place.
None of this should matter for your simple use case: Create Event.
There may also be some downsides to this approach. So you add a publisher action...what do you do with the New Event button everywhere else? There's no perfect solution there. Get rid of the button entirely for all users and push everything through publisher? I'm not certain how possible that is. But at least there is an option for S1 mobile.