function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dcgb2332dcgb2332 

Show custom tasks from object in new custom tab?

Hi Guys,

We have an appex trigger that creates a "new" opportunity in a custom tab (AE Opps), which works perfectly. Now, I'm trying to create a custom tab, called AE Tasks, which will take the tasks from the AE Opps tab, and populate them in the new custom tab (AE Tasks). Is there a way to do this or will I need a new apex trigger?

Many thanks
Best Answer chosen by dcgb2332
Glyn Anderson (Slalom)Glyn Anderson (Slalom)
Are you using the standard Task object?  Or do you have a custom object, AE_Task__c, that looks up to the AE_Opps__c object?

If you're using the standard Task object, then you can't create a custom tab for it.  But you can use the standard Task tab, and create a list view "My Open Tasks" which will show each user the Tasks assigned to them.  This will display ALL their Tasks, not just the ones on the AE Opps records.  With some more work, you could create an "AE Task" record type on Task and have a "My Open AE Tasks" list view filter on that, too.  Am I getting closer?

All Answers

Glyn Anderson (Slalom)Glyn Anderson (Slalom)
Sabrina,  Are you creating a Custom Tab on a Custom Object called "AE Task (AE_Task__c)"?

This will let you create List Views to filter all AE Task records based on criteria - subject, of course, to Object Permissions and Sharing Settings.  So, yes, the AE Task tab should have an "All" list view that show all AE Task records (that the user is allowed to see).  Does that answer your question?  Or do you have a different use case?
dcgb2332dcgb2332
Hi Glyn, Yes, I would be creating a new custom tab on a custom object (current O is AE_Opps_o). I tried filtering by tasks, but it just shows the opportunities, which is great, but I can’t drill down into the specific tasks, other than running a report. While the report is great, the end user is asking for it to show up in a new tab, rather than a report, so that the users can click directly on their tasks. Sorry if this is confusing, I created this all from scratch so there’s really no precedence when it comes to Salesforce and these custom objects.
Glyn Anderson (Slalom)Glyn Anderson (Slalom)
Are you using the standard Task object?  Or do you have a custom object, AE_Task__c, that looks up to the AE_Opps__c object?

If you're using the standard Task object, then you can't create a custom tab for it.  But you can use the standard Task tab, and create a list view "My Open Tasks" which will show each user the Tasks assigned to them.  This will display ALL their Tasks, not just the ones on the AE Opps records.  With some more work, you could create an "AE Task" record type on Task and have a "My Open AE Tasks" list view filter on that, too.  Am I getting closer?
This was selected as the best answer
dcgb2332dcgb2332
Glyn, I think so! We’re really very close! How can I add the tasks tab? We do not have it on our ribbon and I can’t find it under “Customize my tabs”… Thank you!
Glyn Anderson (Slalom)Glyn Anderson (Slalom)
Sabrina, I started writing a response with instructions, then realized you are probably using Salesforce Classic, and not Lightning Experience.  Am I right?  Because Classic does not have a Tasks tab, and LEX does.  There is a kludgy way to view the Tasks tab in Classic -- edit the URL in your browser so that after "salesforce.com" it has "/007".  So the result would look like:

    https://<instance>.salesforce.com/007

OR

    https://<my-domain>.my.salesforce.com/007

It is possible to create a VF page that redirects to this URL, then create a VF Tab called "Tasks".  If this is what you need done, I can help.

On the other hand, if you are able to use LEX, then the whole thing requires just a bit of configuration.

Let me know...
dcgb2332dcgb2332
Glyn, You’re the best! I am using SF Classic (the org has no desire to change to LEX) I took most of the information you provided and kind of did the “kludgy” way you mentioned. I utilized the Web Tabs and pulled the tasks view (https://na30.salesforce.com/007(inserted the list view) and was able to view exactly what I needed. Really appreciate your help with this! I’ll mark your answer as best. Thank you again!!!!
Glyn Anderson (Slalom)Glyn Anderson (Slalom)
I'm glad this worked for you!  I also tried the Web Tab solution, but didn't like it because the Salesforce header is duplicated inside the tab.  If this doesn't bother you, cool!  However, if you want to get rid of that, the Visualforce page redirection is the way to go:
//  The Apex controller class
public class TaskTabController {
    public PageReference redirectToTaskTab()
    {
        return new PageReference( '/007' );
    }
}

//  The Visualforce page
<apex:page controller="TaskTabController" action="{!redirectToTaskTab}" />
​
Then, create a Visualforce Tab, and you're all set!
dcgb2332dcgb2332
Thank you, Glyn! I noticed that as well and it annoys me some haha. I’ll try the VF route and let you know!
dcgb2332dcgb2332
Glyn, Do I need to make any changes to the code before creating the VF page?