1

enter image description herewe are migrating classic project to lightning . user need ability to create new listview for Activity object also able to access and update existing list views. i have created below vf page with vf tab.

<apex:page >
    <apex:enhancedList customizable="true" type="Activity" height="500"/>
</apex:page>

but look and feel is not close to lightning ...please help me how can we create lightning component for this requirement. below is my sample code: class :

public class listviewController {
    @AuraEnabled
    public static List<ListView> getListViews() {
        List<ListView> listviews = 
            [SELECT Id, Name FROM ListView WHERE SobjectType = 'Activity' ];
        return listviews;
    }
}

lightning component :

<aura:component controller="listviewController" implements="force:appHostable,flexipage:availableForAllPageTypes" access="global">
    <ltng:require styles="/resource/slds0121/assets/styles/salesforce-lightning-design-system.min.css"/>
    <ltng:require styles="{!$Resource.SLDS +
         '/assets/styles/salesforce-lightning-design-system.css'}"/> 
   <aura:dependency resource="markup://force:navigateToList" type="EVENT"/>
        <aura:handler name="init" value="{!this}" action="{!c.gotoList}"/>    
 </aura:component>

Js controller :

({
    gotoList : function (component, event, helper) {
        var action = component.get("c.getListViews");
        action.setCallback(this, function(response){
            var state = response.getState();
            console.log('clicked');
            if (state === "SUCCESS") {
                var listviews = response.getReturnValue();
                var navEvent = $A.get("e.force:navigateToList");
                navEvent.setParams({
                    "listViewId": listviews.Id,
                    "listViewName": null,
                    "scope": "Activity"
                });
                navEvent.fire();
            }
        });
        $A.enqueueAction(action);
    },
})

1 Answer 1

1

Update: Assuming you want to show VF tab in LEX, you can do this starting Winter 18. You can simply include lightningStylesheets= true to apply lightning CSS to any VF page

https://releasenotes.docs.salesforce.com/en-us/winter18/release-notes/rn_vf_lightningstylesheets.htm

this is the output of the Listview VF tab in LEX mode.

enter image description here

If this is a custom list view as of today you cannot create a custom list view for Tasks in lightning:

I am surprised that you are seeing the classic list view embedded inside the lightning page, are you on summer 17 or winter 18 ?

Ref:

https://help.salesforce.com/articleView?id=000232885&type=1

Vote here for customization of task list:

https://success.salesforce.com/ideaView?id=08730000000LjIQAA0

1
  • I am using Visualforce page with Tab
    – Hare
    Commented Nov 14, 2017 at 16:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .