0

This is a follow up to previous conversations. None of the previous answers have told me what I've needed, so I'm thinking that what I want is probably impossible. But it would be great if someone could say, with certainty, "What you are trying to do is impossible."

I've built an app, and I've turned it into a Managed Package, and soon I would like to release it on the Salesforce App Exchange.

Assume I have a VisualForce page that appears at an URL like this:

/apex/MegaSearch

When I'm in my own Salesforce developer account I can create a link to it like this:

"Create a Custom Tab"

https://trailhead.salesforce.com/en/modules/customizing_user_interface/units/ui_nav_buttons_links

This works great when I'm working in my own developer account. If I:

1.) click on Setup

2.) type "tabs" into Quick Lookup

3.) click Create / Tabs

4.) click "VisualForce Tabs" New

5.) Choose MegaSearch as the VisualForce page that I want to link to.

And when I'm done with that, a link to MegaSearch appears in the navigation at the top of the page.

I'd like to automate this for my customers, when they install the app. I was hoping there was some way to maybe use something like a PostInstall calls to walk through the above steps.

All of the questions/answers that I've found fail to answer my question.

For example, take this question:

Is there a way that I can automatically add a link to the navigation when a company installs our app?

Mohith Shrivastava gave an answer: create a custom link, following directions from here:

https://help.salesforce.com/articleView?id=develop_documentation.htm&language=en_US&type=0

I followed all these directions, and I created a page. But this isn't what I want. This just means the user sees a "Configure" link when they first install the app. What I want is a link that shows up in the top navigation on every page that the user ever visits on Salesforce.

And there is also this:

"How to show a VisualForce page on the first installation of the managed package?"

How to show a Visualforce page on the first installati​on of the managed package?

But that doesn't interest me. I want a permanent link to my VisualForce page, a link that always appears. I don't need to do anything special on the first viewing.

Is there a way I can automate these steps so my customers do not need to do this:

1.) click on Setup

2.) type "tabs" into Quick Lookup

3.) click Create / Tabs

4.) click "VisualForce Tabs" New

5.) Choose MegaSearch as the VisualForce page that I want to link to.

Is there a way to do this for them, perhaps from a PostInstall script?

  • 2
    basically, you would like your managed package to include an app with predefined tabs that are linked to your megasearch visualforce page(s), correct? – glls Apr 26 '17 at 22:36
  • Yes. Is that possible? – LRK9 Apr 27 '17 at 0:37
  • yes it is - specified in the documentation developer.salesforce.com/page/An_Introduction_to_Packaging – glls Apr 27 '17 at 0:41
  • I read that page, but I didn't see anything about creating a tab that gets auto inserted into an orgs navigation. Is there some sub-section that I should read again more carefully? – LRK9 Apr 27 '17 at 5:27
  • Actually, this might mis-state the case: "an app with predefined tabs that are linked to your megasearch visualforce page". Rather, I want my customers to install a managed package into their orgs, and as soon as they install it, some kind of PostInstall script runs, which creates a custom Tab and links it to the page which works as the starting point of my app. Is this possible? – LRK9 Apr 27 '17 at 5:29
1

Yes, packaging an app with tabs and visualforce pages is possible, as specified here.

Here is a table of many of the different types of components that can be packaged:

Apex Class

Apex Trigger

Custom App

Custom Button and Link

Custom Field Definition

Custom Home Page

Custom Object Definition

Custom Report Type

Custom S-Control

Custom Tab Definition

Dashboard

Document

Email Alert

Email Template

Field Update

Folder

Home Page Component

Letterhead Profile

Settings

Report

Static Resource

Task

Visualforce Component

Visualforce Page

Workflow

Outbound Message Workflow Rule

| improve this answer | |
  • OH, I see! I can just include the tab like any other component! – LRK9 Apr 27 '17 at 5:35
  • Sad to say, this didn't work. I added the custom tab to my managed package and then uploaded it as a beta release. Then I logged out of my account. Then I created a completely new Developer account on Salesforce, using a new email address. Then I logged into the new account. Then I copy and pasted the install URL for the managed package. I clicked the install URL, and clicked through 3 install dialogues. And the managed package was successfully installed in the new account. But the link to my app never appeared in the navigation. The custom tab is in the package, but it doesn't show up in nav. – LRK9 Apr 27 '17 at 5:46
  • In my new Developer account, if I go the page "Customize tabs", then I can pick out various tabs: Account, Opportunities, Contacts, and my search app. If I save that, then all the tabs I selected appear in the navigation bar, including the link to my own app. But I can not figure out how to automate this. As it is, I am still doing this manually. – LRK9 Apr 27 '17 at 6:24

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.