0

I am working in Salesforce1 for the first time. I have a requirement for when a Task's Status is marked as 'Completed' the new Task page should automatically open to allow a user to immediately create a new task.

I came up with two possible solutions but have't been able to determine how to implement either one.

  1. Is it possible to override the 'Save' button on the Edit Task page to check to see if Status == 'Completed' Open a new page, else go to the detail page? I have not been able to find any documentation showing how to complete this.

  2. Is it possible to redirect the New Task button to a custom SF1 page where I can control what the 'Save' button does?

Thanks

  • 2
    Look at Actions for possible solutions to what your asking. I don't have time at the moment to give you a more complete response. Also, look at RecordTypes as an option too where when the Type changes to completed, the page offers a new Task Object Action. – crmprogdev Jun 5 '15 at 16:54
  • @crmprogdev thank you for the tips. I am looking into Actions and how to create them. – Mike Jun 8 '15 at 13:48
2
  1. You can't override the logic for the standard Save button on the default Task Edit page.

  2. You can override the New Task button to use a custom Visualforce page where you can implement any logic you need, but you would also need to re-create the entire standard Task Edit page manually. Do this under Setup > Customize > Activities > Task Buttons, Links, and Actions > New Task. From here you can pick a Visualforce page to use when any user tries to create a New Task.

The above option (2) is a lot of work. I would strongly consider just creating a simplified action that can be used to modify the status specifically. You can create a Visualforce page and new action for Tasks, maybe call it "Update Status." A user can tap on this action (from the Task detail page) in Salesforce1 when they want to change status. From this page you can update the field and navigate the user as needed based on the status value. With an action you can override the behavior of the Submit button as discussed here:

Salesforce1 Publisher Action Submit Button overwrite

This would not work with newly created tasks that are marked as Completed from the start, but should work as long as the workflow starts with a Task that has already been created.

| improve this answer | |
  • 1
    Another note, be sure to use the Salesforce1 navigation functions to call the New Task page from Visualforce e.g. sforce.one.createRecord('Task') developer.salesforce.com/docs/atlas.en-us.salesforce1.meta/… – Kalin Jun 5 '15 at 21:44
  • Thanks for the Answer, I am looking into actions and applying them to my project. – Mike Jun 8 '15 at 13:48
  • 1
    Was the custom Vf page set to "Available for Salesforce Mobile apps" in the Setup menu? There is a checkbox that needs to be enabled for Salesforce1 to be able to recognize the page. – Kalin Jun 8 '15 at 20:32
  • 1
    It may also be worth checking your Page Layouts <> Record Type associations to ensure the record you are testing with is using the intended Layout. One last thing I can think of is to ensure the record you are testing with is refreshed in the Salesforce1 app so the app checks for changes. Have you tried a fresh login to test with? – Kalin Jun 8 '15 at 20:34
  • 1
    Glad that helped! I have overlooked it many times myself. So the ordering of those actions is system defined for now (with the introduction of the action bar a couple releases ago), however it looks like the Summer '15 release gives more control over this ordering specifically for the Salesforce1 mobile app. It may be that your instance has not yet been updated, but it should soon. I have not yet played with the ordering myself yet with the Summer update: docs.releasenotes.salesforce.com/en-us/summer15/release-notes/… – Kalin Jun 10 '15 at 18:42

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.