4

Is it possible to get the tab style from the sObjectType? In other words, if I have an object with a tab icon of "People", the tab style I'd want to return is "Custom15"... Any ideas?

7

There are ways to get to this data, depending on the context.

Page

<apex:page standardController="People__c" tabStyle="People__Tab" ...

Apex Code

Call Schema.describeTabs().

API

Just call binding.describeTabs() from your application. The documentation includes examples in Java and C#.

9
  • 2
    You can also use the describeTab feature in native Apex now, no need to import the Partner WSDL, salesforce.com/us/developer/docs/api/Content/… Dec 5 '13 at 19:07
  • @AndrewFawcett Thanks for that. I somehow missed that in the documentation. Google is still indexing all the old answers about using the WSDL, and that was that last I'd knew of it, too. Time to re-read the manual again!
    – sfdcfox
    Dec 5 '13 at 19:10
  • I'm intrigued by your Apex Code section. I am trying to recreate the relatedList functionality with a bunch of other features built in (user can sort, filter, export, customize columns, etc). I have a cosmetic desire to replicate the object-related icons as are present natively, but it's not a show-stopper... I've never used wsdl2apex, I'll give that a shot... Dec 5 '13 at 19:12
  • @AndrewFawcett Also, you linked to the wrong docs in your comment, but I've updated my answer.
    – sfdcfox
    Dec 5 '13 at 19:13
  • 1
    @NathanWilliams In that case, you can describe them in Apex Code, like Andrew mentioned; I'd store the icon URL in a variable or wrapper object.
    – sfdcfox
    Dec 5 '13 at 20:53

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.