Skip to content

Commit 5b64e1f

Browse files
committed
Update README.md
1 parent c5067a1 commit 5b64e1f

File tree

1 file changed

+161
-16
lines changed

1 file changed

+161
-16
lines changed

README.md

Lines changed: 161 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,178 @@ The team within Salesforce.org have configured Animal, Treatment, Condition, Ado
66

77
Animal Shelter Starter is built to scale with your organisation, providing you with a foundation to begin managing your animals from rescue to recovery and beyond. Utilising the Salesforce platform, you will be able to take full control of your operations with the power of the world’s leading CRM.
88

9+
# Deployment
10+
11+
## Installing in Sandbox or Production
12+
13+
### Option 1: AppExchange Installation (Recommended)
14+
15+
1. Visit the [Animal Shelter Starter listing on the AppExchange](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000G0zBTUAZ)
16+
2. Click "Get It Now" and select your target org
17+
3. Choose installation options:
18+
- **Install for Admins Only** (recommended for initial setup)
19+
- **Install for All Users** (after configuration is complete)
20+
4. Review and accept permissions
21+
5. Complete the installation
22+
23+
### Option 2: Manual Deployment via Salesforce CLI
24+
25+
**Prerequisites:**
26+
27+
- Salesforce CLI installed
28+
- Access to target sandbox/production org
29+
30+
**Steps:**
31+
32+
1. Clone this repository:
33+
34+
```bash
35+
git clone https://github.com/SalesforceLabs/AnimalShelterStarter.git
36+
cd AnimalShelterStarter
37+
```
38+
39+
2. Authorize your target org:
40+
41+
```bash
42+
sf org login web --alias production
43+
# or for sandbox:
44+
sf org login web --alias sandbox
45+
```
46+
47+
3. Deploy the metadata:
48+
49+
```bash
50+
sf project deploy start --target-org production
51+
# or for sandbox:
52+
sf project deploy start --target-org sandbox
53+
```
54+
55+
4. Assign the Animal Shelter Starter permission set to users:
56+
```bash
57+
sf org assign permset --name "Animal_Shelter_Starter" --target-org production
58+
```
59+
60+
## Post-Installation Configuration
61+
62+
1. **Setup Custom Settings**: Configure any custom settings required for your organization
63+
2. **Data Import**: Use Data Import Wizard or Data Loader to import existing animal data
64+
3. **User Training**: Ensure users are trained on the new objects and processes
65+
4. **Testing**: Thoroughly test all functionality in a sandbox before production deployment
66+
967
# Development
1068

11-
Please note that you must have access to the managed package namespace before you can work on this package. Please reach out to the team if you internal to Salesforce and want to work on this package.
69+
Please note that you must have access to the managed package namespace before you can work on this package. Please reach out to the team if you are internal to Salesforce and want to work on this package.
70+
71+
## Prerequisites
1272

1373
### Dependencies
1474

1575
- VSCode > https://code.visualstudio.com/download
1676
- Salesforce Extension Pack > https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode
17-
- Salesforce DX > https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm
18-
- GitHub Desktop > https://docs.github.com/en/desktop/installing-and-authenticating-to-github-desktop/installing-github-desktop
77+
- Salesforce CLI > https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli.meta/sfdx_cli/sfdx_cli_install.htm
78+
- Git > https://git-scm.com/downloads
79+
- GitHub Desktop (Optional) > https://docs.github.com/en/desktop/installing-and-authenticating-to-github-desktop/installing-github-desktop
80+
81+
### DevHub Access
82+
83+
Request access to the DevHub from Stewart Anderson. The DevHub is required for creating namespaced scratch orgs for managed package development.
84+
85+
1. Open the command palette in VSCode (`Cmd + Shift + P` on Mac, `Ctrl + Shift + P` on Windows)
86+
2. Select "SFDX: Authorize a DevHub"
87+
3. Login with your provided credentials
88+
4. Verify connection with: `sf org list --all`
89+
90+
## Development Workflow
1991

20-
### DevHub
92+
### Initial Setup
2193

22-
Request access to the DevHub from Stewart Anderson. Once you have a username and password do the follow:
94+
1. **Fork and Clone**: Fork the repository and clone your fork locally
2395

24-
1. Open the command pallette in VSCode and select "SFDX: Authorize a DevHub"
25-
2. Login with you details
26-
3. Done
96+
```bash
97+
git clone https://github.com/YOUR-USERNAME/AnimalShelterStarter.git
98+
cd AnimalShelterStarter
99+
```
100+
101+
2. **Create Feature Branch**: Always create a new branch from master
102+
```bash
103+
git checkout master
104+
git pull origin master
105+
git checkout -b feature/your-feature-name
106+
```
107+
108+
### Working with Namespaced Scratch Orgs
109+
110+
Since this is a managed package, you must use **namespaced scratch orgs** for development:
111+
112+
1. **Create Namespaced Scratch Org**:
113+
114+
```bash
115+
sf org create scratch --definition-file config/project-scratch-def.json --alias dev-org --duration-days 30 --set-default
116+
```
117+
118+
2. **Deploy Source**:
119+
120+
```bash
121+
sf project deploy start --source-dir force-app
122+
```
123+
124+
3. **Open Scratch Org**:
125+
```bash
126+
sf org open --target-org dev-org
127+
```
27128

28129
### Development Process
29130

30-
Before you start development of a new fix or feature, ensure you have created a new branch from the master branch and then open that with VSCode. This is best done on the GitHub page.
131+
1. **Make Changes**: Develop your feature/fix in the scratch org
132+
133+
- Add new objects, fields, flows, etc.
134+
- Update the **Animal Shelter Starter** permission set with any new permissions
135+
- Test functionality thoroughly
136+
137+
2. **Retrieve Changes**:
138+
139+
```bash
140+
sf project retrieve start --source-dir force-app
141+
```
142+
143+
3. **Version Control**:
144+
145+
```bash
146+
git add .
147+
git commit -m "Description of your changes"
148+
git push origin feature/your-feature-name
149+
```
150+
151+
4. **Create Pull Request**:
152+
- Go to GitHub and create a PR from your feature branch to `master`
153+
- Include detailed description of changes
154+
- Add screenshots/videos if UI changes are involved
155+
156+
### Important Development Notes
157+
158+
- **Namespace Awareness**: All custom objects, fields, and components will be automatically namespaced
159+
- **Permission Sets**: Always update the Animal Shelter Starter permission set when adding new metadata
160+
- **Testing**: Include appropriate test coverage for any Apex code
161+
- **Documentation**: Update relevant documentation for new features
162+
163+
### Troubleshooting
164+
165+
- **Namespace Issues**: Ensure you're using a namespaced scratch org from the correct DevHub
166+
- **Permission Errors**: Verify the Animal Shelter Starter permission set includes all necessary permissions
167+
- **Deployment Failures**: Check for missing dependencies or incorrect API versions
168+
169+
### Useful Commands
170+
171+
```bash
172+
# Check org info
173+
sf org display --target-org dev-org
174+
175+
# View org limits
176+
sf org display limits --target-org dev-org
177+
178+
# Delete scratch org
179+
sf org delete scratch --target-org dev-org
31180

32-
1. Once you have opened this repo locally within VSCode, start by creating a scratch org. You can use the command pallette for this, on MacOS you can use Cmd + Shift + p within VSCode. Choose the option called "SFDX: Create a default scratch org...". Accept the default options to create the org.
33-
2. Once created, right-click on the force-app folder and select "SFDX: Deploy Source to Org". This will deploy the current package source to the scratch org.
34-
3. Make required changes in the scratch org. Remember to add any required permissions for objects, fields etc to the Animal Shelter Starter permission set.
35-
4. Pull changes back to VSCode by using the command pallette and select "SFDX: Pull Source from Default Org and override conflicts".
36-
5. Switch to GitHub Desktop and provide details for the changes and then push the changes back to GitHub.
37-
6. Once you are happy with your changes, re-open the GitHub page and create a Pull Request for your feature branch back to the master branch.
38-
7. Done
181+
# Run tests
182+
sf apex run test --test-level RunLocalTests --target-org dev-org
183+
```

0 commit comments

Comments
 (0)