3

I would like to modify the url of my Web Tab for each SF organization that my managed package is installed on. Is there a way to get and set the url of a Web Tab from Apex or the REST Api? Is there a SObject that stores the state of a Web Tab? If so, what is its name?

This question is similar but no apex code to modify the url was given.

If you want to learn more about Web Tabs, start by making one in your org.

edgartheunready
  • 2,935
  • 7
  • 23
  • 38
  • 1
    This "Apex Wrapper Salesforce Metadata API" https://github.com/financialforcedev/apex-mdapi appears to include CustomTab: I haven't tried it so can't comment further though. – Keith C Mar 17 '14 at 22:34

1 Answers1

2

I am taking a guess here :

Based on this question you can access the metadata api from apex as below :

Has anyone, ever, successfully invoked the Metadata API from within Apex?

In your case you need to be looking at customtab from here :

http://www.salesforce.com/us/developer/docs/api_meta/

Combining both might do the trick ")

MetadataService.MetadataPort service = createService();     
MetadataService.CustomObject CustomTab = new MetadataService.CustomTab();
CustomTab.URL = 'www.abc.com';
//not sure what else u might need to create a tab, required vals might be missing here.
MetadataService.AsyncResult[] results = 
    service.create(new List<MetadataService.Metadata> { CustomTab});
Rao
  • 16,691
  • 13
  • 68
  • 108