Skip to content

Iteration XI Setup Instructions

rhys kim edited this page May 27, 2022 · 12 revisions

Iteration XI

Links to Sections

Branch & Dev Hub Setup
Salesforce Settings/Setup
Package Installation/Deployment
Community Site Setup
Test Data Creation
Creation & Versioning of NEW Package

Click here for [Previous Iteration’s] Documentation <-- Create a link to the previous iteration section if Possible

Repo/Branch & Dev Hub Setup:

The below instructions will help you to set your Salesforce Org up to deploy the packages and components directly into your Salesforce Org using Visual Studio Code and the Salesforce Expansion Pack.

Click To Expand Branch Setup Instructions

Step 1: Clone the Trial of the Titans Repo

a) Launch Visual Studio Code

b) Open Source Control ( Ctrl + Shift + G | Command (or Cmd) ⌘ + Shift + G on Mac ) and Select Clone Repository

c) Enter "https://github.com/revaturelabs/TrialoftheTitans" (sans quotes)

d) Create a new folder and select it

e) Select Open when this pop extension shows up
open cloned repo

Step 2: Set up your Dev Hub

a) Create a new Playground at Salesforce Trailhead

b) Launch your created Playground and reset the password by clicking the "Get Your Login Credentials" tab.
GetCreds

Make note of your username as this is important in the following steps.
logincreds

c) Now click the Reset My Password button.
ResetPassword

d) Navigate to Setup and search dev hub in the Quick search
SetUp
DevHub

e) Enable Dev Hub and Unlocked and Second-Generation Managed Packages
EnableToggle
ToggleEnable

Step 3: Authorize your Dev Hub in Visual Studio Code

a) In the command pallet (CTRL + SHIFT + P on Windows | Command (or CMD) ⌘ + Shift + P on Mac): SFDX: Authorize Dev Hub

b) Select Project Default

c) Enter an Alias for your org (ex: ToTT or TrialofTitans)

d)Login using the username and password from Step 2.
Login

e) Open a new terminal in VS Code (CTRL + SHIFT + on Windows | CTRL + on Mac)

f) Set your default username using the CLI Command:
sfdx config:set [email protected]

Salesforce Package Deployment/Installation:

The below instructions will help you in installing the TrialOfTheTitans base package, and all other Iteration’s work henceforth. You will be installing a base package, manually deploying 4 folders (Package creation was not done correctly, this is the workaround). Then you will install Iteration XI’s unlocked package last. Then install the DataFactory unlocked package, and you’ll then be able to set Salesforce up with required settings.

Click To Expand TotT Installation Instructions

Step 1: Install the Trial of the Titans Package:

  • In the command pallet (CTRL + SHIFT + P on Windows | Command (or CMD) ⌘ + Shift + P on Mac): >SFDX: Install Package
  • Paste this line into the command pallet when it asks for the 04t code: 04t5f000000GsMdAAK
  • Let this run to install the package.
  • Alternatively you can use the CLI by opening a terminal and running the code:
    sfdx force:package:install --package "[email protected]"

    NewTerminal

Step 2: Deploy the First Manifest:

  • Look in the manifest folder and right click the file Iteration-XI-DeployFirst.xml then click SFDX: Deploy Source in Manifest to Org.

    Deploy

Step 3: Deploy Both Hubs Simultaneously:

  • Collapse the Manifest folder.
  • CTRL+ Click TitHubPackage and HeroHubPackage.
  • Right click one of the two packages and click SFDX: Deploy Source to Org.

    DeployCapture

Step 4: Deploy Final Manifests and Package:

  • Return to the Manifest folder and right click and deploy each one of these files in order, one at a time:
    a) Iteration-XI-DeploySecond.xml
    b) Right click + Deploy Source to Org on the ExamInterviewPackage folder. b) Iteration-XI-DeployThird.xml

Step 4.5: Salesforce User Setup:

Head to the Salesforce User Setup and complete those steps before trying Step 5.

Step 5: Deploy Final Manifest:

a) Iteration-XI-LastDeploy-DataFactory.xml

Step 6: Install PortfolioPackage:

  • Install the PortfolioPackage by opening the integrated terminal and running this command:

    sfdx force:package:install --package "[email protected]"

Step 7: Install EmployerPartnerPackage:

  • Install the EmployerPartnerPackage by opening the integrated terminal and running this command:

    sfdx force:package:install --package "[email protected]"

Salesforce User Setup:

The below instructions will help you in setting up Salesforce, changing required settings. You will create a (blank) Digital Experience/Community Site, create a ‘Hero’ Profile, create a ‘TitanTrainer’ profile, set a User Role to your System Administrator, Set a couple CSP Trusted Sites, and a couple other small settings changes.

Click To Expand Salesforce Instructions

Step 1: Create Titan Trainer profile

  • In the setup section of your Salesforce Dev Hub navigate to Users>Profiles.
    ProfilesCapture

  • Navigate to the “Standard User” profile either by clicking the Next button at the bottom or by filtering S.
    ProfilesCapture

  • Once the "Standard User" profile has been found click on "Clone".
    CloneCapture

  • For the profile name, use “TitanTrainer” explicitly, no space between. TTrainerCapture

  • At the top of the next page, locate the “Enabled Apex Class Access” hyperlink, and click on it.
    TTrainerCapture

  • Click the Edit button.

  • Select all classes located inside of the left box, and move them to the right box. Hit Save. TTrainerCapture

  • Select Edit on the profile main section.
    TTrainer1Capture

  • Scroll down to the Custom Objects Tabs section and change all of the tabs from "Tab Hidden" to "Default On."
    tabsCapture

  • Scroll down to the “Standard Object Permissions” section, and ensure Account and Contact are listed as Read/Create/Edit/Delete permissions.
    AccountCRUDCapture
    ContactsCapture

  • Scroll further to the Custom Object Permissions set.

  • Make sure every single Custom Object has Read permission at a minimum. You may want to give full CRUD access, but that’s at your discretion. (These 2 profiles are not heavily referenced, except in Test classes.)
    CustomObjCapture

  • Click Save.

Step 2: Create Hero profile

  • In the Users>Profiles page once more, locate the “Customer Community User” profile.

  • Select Clone

  • Name your new profile “Hero”

  • In the same way as with the TitanTrainer profile, enable all custom Apex Classes, and give (minimum) Read access to Account and Contact Objects.

You will need to return to this profile after setting up Experience Site to apply CRUD permissions to Custom Objects

Step 3: Set SysAdmin to have Role ‘The Man’:

  • In Setup, navigate to Users and click Users
    UsersCapture

  • Locate your User with the System Administrator profile, and click Edit.
    SysAdminCapture

  • In the top right-hand corner, select the Role dropdown, alphabetically locate ‘The Man’, and set the role to that.
    TheManCapture

  • Click Save.

Step 4: Add CSP Trusted Sites:

  • In the main Setup page, navigable to via the “Home” button, use the “Search Setup” bar at the top, and type in “CSP Trusted Sites”. Click on the one option that shows up.
    CSPCapture

  • At the top of the middle section, click on the New Trusted Site button.
    NewTrustedCapture

  • For the Name, use Discord, then paste this https://cdn.discordapp.com into the URL box. Under the CSP Directives, toggle all ON. Select Save & New.
    SaveCapture NewSaveCapture

  • Repeat Step 4 using ‘Cloudinary’ as the name, and https://res.cloudinary.com as the URL. Select Save.

Step 5: Enable And Create a Blank Digital Experience Site

  • Navigate to Setup and use the Quick Find bar a the top left to find "Digital Experience". Click on "Settings." If you already see more options then please continue to follow the steps to make sure your digital site has been properly setup.
    DigitalCapture

  • You should see a single checkbox “Enable Digital Experiences”.

  • Toggle On.

  • Then create a domain name. It will need to be world-wide unique. But make sure it’s Titan related. Our go to was “TotTitans” and then roughly five(5) random numbers afterwards. Click Save.

  • On the settings page scroll down to the "Role and User Settings" section and make sure the checkbox for "Allow using standard external profiles for self-registration, user creation, and login" has been checked. Click Save. SettingsCapture

  • Click "All Sites" in "Quick Find" navigation.
    NavCapture

  • In the middle, towards the top, select New. This step may take awhile to load, be patient as clicking New too fast will force you to refresh and try again.
    NewCapture

  • On the template selector page you’ve been brought to, scroll down to the template called “Build Your Own (Aura)”.
    BuildCapture

  • Click on the ‘Get Started’ button. Name this site “Trial Of The Titans”, with spaces. Click Create, and then wait for the next page to be brought up before moving on.
    NewPageCapture

  • Click on the “Administration” button.
    AdminCapture

  • On the left-hand side, click "Members".

  • Under the Select Profiles section, use the Search: dropdown and change it from “Internal” to “Customer”.

  • In the left box, locate the “Hero” profile, and add it to the right box. Scroll down and hit Save.

Adding Hero to Members
  • On the left-hand side, click “Login & Registration." Scroll to the bottom where you will find a Checkbox labeled “Allow customers and partners to self-register”. Toggle this ON.

  • Under the section the Checkbox opened up, locate the Profile drop down menu, select the “Hero”, and then hit Save at the bottom. (Do NOT assign an Account)

Selecting Hero profile in Login & Registration
  • Make sure to return to the Hero Profile to edit, and set every single Custom Object to Read permission at a minimum. Here are our suggested settings:
Hero profile Custom Object permissions
  • Make sure to return to Steps 5 and 6 of the Deployment section and deploy the last manifest and install PortfolioPackage before proceeding further.

Community Site Setup:

The below instructions will help you in setting up and creating a Community Site. You should have already created a blank site in the Salesforce User Setup section of instructions. You will set up the Theme Layout for the base page/Landing, then you will set up Three(3) pages. One for the Titan Hub, one for the Exam Interview Page, and then one for the Portfolio page.

Click To Expand Community Site Instructions

Step 1: Setting up a Theme and Hero Result Page:

  • Go ahead and remove the template component that comes with a brand new site. It starts with "Let's get started!" You won't be needing this.

  • Locate the gear icon on the left hand side at the bottom of the menu and click it. This is the settings menu for the whole site.

  • Now click Theme and then Configure.

  • Click "New Theme Layout"
    ThemeCapture

  • Create your theme name. It can be whatever you like but try to keep it inline with the project.
    NameCapture

  • Change the Layout to HeroResultPage.

  • Click Save

  • Click on the gear icon located in the Home tab at the top of the page.
    HomeCapture

  • Scroll to the bottom of the menu on the right and locate the "Override the default theme layout for this page." checkbox and make sure it is checked.

  • In the Theme Layout box that appears change the layout to the Titan Theme (or whatever you named it in the previous steps.)
    OverrideCapture

Step 2: Create the Titan Hub Page:

  • Click the Home Tab and then click "+ New Page" at the bottom.
    NewPageCapture

  • In the option box that pops up choose "Standar Page," then "+ New Blank Page," then "1 full-width column" under Current Layouts.

  • Click Next.

  • Enter the name as Titan Hub and the API name as Titan_Hub.
    TitanHubCapture

  • Click Create.

  • In the components tab on the left hand side use the quick search with the term titan. Find the titanHubPage custom component and drag this component to the content block on your page.
    TitanHubPageCapture

Step 3: Create the Exam Interview Page:

  • Follow the same steps as above until you get to where you name your page. Here you will use Exam Interview and Exam_Interview as the name and API name for the page.

  • When you search for the custom component you will use the search term lwcExamInterview.

  • Drag this component to your page.

Step 4: Create Portfolio Page:

  • Follow the same steps as above to create a new Blank single full-length-column Page. Here you will use "Portfolio" as the name and API name for the page.

  • Open Components, and search for 'app'. Drag the lone result from Custom Components into the Content section of the page

  • Click publish at the top right hand side of the page. Click Publish again in the modal that appears.

  • You have now created your digital experiences site!

  • Proceed to the next section to set up a user for the site. If you have not created the appropriate profiles yet please return to the Salesforce User Setup section and do so at this time.

Step 4:

Create the Exam Interview Page:

Test User/Account/Contact:

The below instructions will help you in setting up and creating a Test User for your Community Site. This is explicitly an optional step, just to make sure you’ve followed all previous instructions before you continue. It is still Highly Recommended.

Click To Expand Test User Instructions

Step 1: Add the appropriate fields to the Account Page Object:

  • Navigate to the Account object in Setup.

  • Click on Page Layout, and then Account Page Layout.

  • Add these four fields to the page layout.
    a) Cohort
    b) Curriculum
    c) Team
    d) Squad

  • Click Save.

Step 2: Create a new Account and Contact:

  • Use the App Launcher and go to Account

  • Click New.

  • Add a first name and last name on the account and choose a Squad, Cohort, Curriculum, and Team.

  • Click New on Contact on the Related tab.

  • Create a contact based on the account you just created.

  • Now using the dropdown on the far right click Enable Customer User.

  • When the page loads add a working email and make sure their username and nickname are globally unique.

  • Change the License to Customer Community

  • Change the Profile to Hero

  • Click Save.

  • Back on the Contact page use the dropdown to Login to Community User Site

  • You should now see a fully populated Trial of the Titans site as the user!

Data Factory/Test Data Creation:

The below instructions will help you in using the Data Factory to create mock/test data for you to develop/work with. DO! NOT! PUT! NEW! FACTORY CLASSES HERE! It’s an unlocked, and versioned package. You will be unable to edit the versioning, and you can (and will) break it for future iterations if you mess with it too much. You will want a Data Factory of your own, but DO IT IN YOUR OWN UNLOCKED PACKAGE. (See Instructions on making unlocked packages)

Click To Expand Data Factory Instructions

Step 1: Delete Playground Data

After you have completed org setup and are ready to create test data your first priority should be to delete the data that comes pre-generated in the org. Using whichever tool your prefer delete any data that will not be needed. This would be records such as opportunity records, etc.
We recommend to run Data-Loader for Opportunity records and case records and then run the following command to delete all other data:
ApexDataFactory.DeleteSampleData();

Step 2: Run the Command

Navigate to the Dev Console.
DevConsole

From here you will need to open an Execute Anonymous Window.
ExecuteAnon

Paste the below code into the window.
ApexDataFactory.GenerateData();

This will generate test data that will allow you to see the site in a functional manner.
If you need to delete all test data then please use the code below.
ApexDataFactory.DeleteSampleData();

Step 3: Doublecheck your Work

You will want to make sure that you have actually generated the data so be sure to navigate to the Exam Object.
ExamSearch

You will need to click the blue link to proceed to Salesforce Classic as this object is legacy.
SalesforceClassic

And as long as you see exams there you know the Data Factory has worked.
DataLoaded

Creation And Versioning of NEW Package:

Please follow the steps in Installation Instructions to fully deploy what is currently available for use in the Trial of the Titans Development - Install Instructions

The below instructions will help you in developing a new package.

Click To Expand Package Creation Instructions

After you have successfully deployed the current contents to an org you can begin work on your own package with a scratch org.
MAKE ONLY ONE PERSON THE DEV HUB OWNER WHO WILL MAKE A PACKAGE AND UPDATE.
Remember, as of Spring 22, best practices are that any development done towards a new package should be done within a scratch org so that you can fix any discrepancies before pushing to your Dev Hub.

Step 1: Authorize a scratch org

In VS Code use the command pallet (CTRL + SHIFT + P on Windows | Command (or CMD) ⌘ + Shift + P on Mac) : SFDX: Create a Default Scratch Org...

If you get an error that there is no dev hub information then please return to Step 3 above and set your default username. If the link to Step 3 doesn't work use the Back to Top link to return to the top and expand the Repo/Branch & Dev Hub Setup section.

Step 2: Create Package

Using the CLI you can create a new package with the command
sfdx force:package:create --name "YourPackageName" --packagetype Unlocked -r YourPackageName

*The package in quotes is the actual name of your package. The package name at the end of the command is the directory.

Step 3: Note Dependencies

Develop your package taking note of any needed dependencies of other packages.

Step 4: Deploy Package

Once you have your package developed and ready to deploy to other users you can create a version of the package so that future iterations may simply use the install command.

*Remember, as of Spring '22, your package cannot be versioned by another iteration as they will not have access to the dev hub that you are currently using.

*This will lead to further delays that could hinder the next iteration's attempt at creating content as it may inadvertently create conflicts or issues when trying to "force:deploy" an unversioned package.

*Use sfdx force:package:version:create -x -p "PackageName" -w 10 -v DefaultDevHubName to create a new version of your package that can then be installed.

!!!

IF YOU FORGET TO VERSION YOUR PACKAGE THE NEXT TEAM WILL HAVE TO FORCE DEPLOY YOUR PACKAGE INSTEAD OF BEING ABLE TO SIMPLY INSTALL IT!!!

!!!

Step 5:

Test your package by trying to install it, along with the rest of the packages, onto a clean Playground Dev Hub. (Your New Package LAST) This will allow you to catch any issues that may crop up.

The below instructions will help you in updating and versioning your package if you need to

Click To Expand Versioning Instructions

So, you've successfully created a versioned unlocked package? Congratulations!

If you need to create another version of your package that includes any changes made, to version 0.1.0-1 for instance, you can run the same version command that you used to create the -1 version of your package. This will create a -2 version that will include any and all changes made. Just make sure that your changes are all within your package.

If you've made changes within other packages or have made changes to objects within other packages those changes will not be included when you create and version your iteration's package. So make sure that you have taken note of these changes and include them in any instructions that you leave for the next iteration.

Remember, you should be doing all work that involves your new package within "Iteration ** Package," or whatever you name it. This will ensure that whatever changes you have made will properly install onto an org. Failure to keep all changes within your package, without proper documentation of said changes, will cause delays to following iterations in their attempts to install and create their contributions to this project.

Good luck!!

(To Top of Page)

TRIAL OF THE TITANS

├─Install Instructions
│   ├Site Setup
├─General Documentation
│   ├Data Modeling/Relationships
│         ├Data Model
│         ├Custom Objects & Fields
│   ├Issues & Suggestions
│         ├Known Issues
│         ├Data Model Issues & Suggestions
│   ├Dependency Chart
├─Resources
├─Package Overview
│   ├Trial of the Titans Package
│         ├QC Hub
│         ├Trainer Hub
│         ├Mock Interview
│   ├Chart Package Package
│   ├Hero Hub Package
│   ├Titan Hub Package
│   ├Exam Interview Package
│   ├Portfolio Hub Package
├─Archive

Clone this wiki locally