+ Start a Discussion
chakrapuchakrapu 

How can i get current Application name in my controller?

Hi,

How can i get current Application name in my controller?

what is the piece of apex code.

Thank you.

 

Pradeep_NavatarPradeep_Navatar

Use the code given below to get the application name :

 

describeTabSetResult []  = binding.describeTabs();

 

Use the describeTabs() call to obtain information about the standard and custom apps to which the logged-in user has the access. The describeTabs call returns the minimum required metadata that can be used to render apps in another user interface. This call is used by partner applications to render Salesforce.com data in another user interface.

 

Hope this helps.

Burton024Burton024

This solution throws a compile error.

craigmhcraigmh

I think you're confused in that, despite this being the Apex section, what he posted is not Apex code. You'd use that code in something like Java or .NET. Unfortunately, that doesn't help Apex developers...it seems like SFDC supports you more if you're NOT using their technology.

sarveswaragupta pathisarveswaragupta pathi
public static String getAppName() { UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId = :UserInfo.getUserId() LIMIT 1]; AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId = :userAppInfo.AppDefinitionId LIMIT 1]; return appDefinition.Label; }