2

TL;DR;

My lightning app, when source-pushed to a fresh scratch org.. doesn't show any tabs for the custom page layouts. But every other editing interface in the fresh scratch org indicates they're there and associated with the app.

Full Story

I can create a new lightning app, with custom icon that shows in the App Launcher, and it can have a couple of custom App Pages within it, each on their dedicated tabs. Maybe throw in record-based tab for good measure, say, an 'Account' tab.

I can do all of that in scratch org #1, capture it in my SFDX project in source format. I can associate the app with an appropriate permission set, etcd.

However, if I spin up scratch org #2, and force:source:push what I just captured. The resulting Lightning App is in there, and after I assign the permission set.. it shows properly in the App Launcher. It may have the 'Account' tab.. but.. none of the tabs for the custom layouts (i.e. flexipages) seem to show up.

If I go into Setup > Lightning App Builder (which I think should be renamed to something else, but, I digress), I can see my custom flexipage layouts listed there. If I click on them, I can even see they are properly assigned to my Lightning App. enter image description here

If I go into Setup > Tabs, I can see that the scratch org recognizes the tabs exist.. there they are.

If I go into Setup > App Manager, find my lightning app and click 'Edit' on the right hand column, I can see the custom items properly assigned in the Navigation Items blade's Selected Items, just like I would expect.

enter image description here

0

Ok, I think I have found my issue:

In my .forceignore, I had turned off the 'profiles' business:

# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
#
**profiles

So, I decided to remove the **profiles bit from my .forceignore, and then I went into my scratch org, I added a new Custom Tab pointing to my custom flexiPage. Then I went into the Lightning App Builder > Navigation Items and selected the newly created tab.

Switching back to the browser tab showing my Lightning App, I hit refresh, and so I see my custom tab show up there (but still no source-pushed tab as described in my OP).

Now, I want to investigate the newly created XML metadata, so I:

sfdx force:source:pull

And now I can see the missing ingredients were in the profiles/Admin.profile-meta.xml:

<tabVisibilities>
    <tab>My Source-Pushed Tab</tab>
    <visibility>Hidden</visibility>
</tabVisibilities>
<tabVisibilities>
    <tab>My New Tab</tab>
    <visibility>DefaultOn</visibility>
</tabVisibilities>

The visibility was set to hidden on my source-pushed tab, but DefaultOn on the newly created tab. I belive this is due to my Admin.profile-meta.xml - though originally present in my project and originally had the tabs all DefaultOn, — I believe I ignored it from the initial push - so the org must've defaulted it to Hidden

So I'm happy, believing to have found the "smoking gun" - so, I try testing my theory. I update the Admin.profile-meta.xml so that all the hidden tabs are once again DefaultOn and then I issue a force:source:push. I was surprised that refreshing my browser did not show the immediate result I was expecting. However, launching a private/incognito window into the same org DID indeed prove that this was the fix. My tabs showed up!

| improve this answer | |

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.