In Classic, one can use code like this to determine the app the current user is currently working in

public static String getActiveTab(){
    String tabLabel;
    for(Schema.DescribeTabSetResult i : Schema.describeTabs()) {
        if(i.isSelected()) {
            tabLabel = i.getLabel();
    return tabLabel;

In Lightning, however, this code will return the current (or last) app the user is working with (or was working with) when the user is in Classic. Is there a way to identify the currently selected app in Lightning?


Your Answer

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

Browse other questions tagged or ask your own question.