How-to — task-oriented recipe.
For Salesforce Admins: As Affinity for Salesforce’s Managed Package continues to get updated with more functionality over time, follow these steps to ensure you receive these updates accordingly. The steps below are the same, regardless of whether you’re installing it for the first time or updating it thereafter.
Overview
- How to install/update to the latest Managed Package
- How to assign the Affinity permission set to users
- Option A - Assign automatically with User Access Policies
- Option B - Assign automatically with Flow (or manually)
How to install/update to the latest Managed Package
- As the Salesforce Admin for your organization, you can update to the most recent version of Affinity for Salesforce’s Managed Package by adding this URL path to the end of your Salesforce subdomain:
/packaging/installPackage.apexp?p0=04t5f0000004SDL
2. As you enter the URL on your web browser, you'll be directed to a Salesforce sign in screen - please make sure to sign into the account that you'd want to install the package in.
3. You'll notice three options - please select the option that makes the most sense for your organization, then click **Upgrade** (it will be **Install** if it's your first time):
1. Install for Admins Only
2. Install for All Users (recommended)
3. Install for Specific Profiles
**Note**: We suggest **Install for All Users**, but you can start with **Install for Admins Only** and go back to change who has access afterwards.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/1.jpg" />
4. The upgrade may take a while, so you can click **Done** for now. Rest assured that you'll receive an email notifying you when the upgrade is complete.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/2.jpg" />
5. Once the upgrade is complete, click on **Settings**, then click on **Setup**.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/3.jpg" />
6. On the **Home** tab, search for "installed" and click on **Installed Packages**. Look for the **Affinity for Salesforce** managed package to make sure that you see it updated to its latest version.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/4.jpg" />
## How to assign the Affinity permission set to users
- If this is the very first time that you're installing the Affinity for Salesforce managed package, it will automatically create the **Affinity User** permission set.
- The **Affinity User** permission set will allow you to add specific team members for approved access to the Visualforce components for Affinity for Salesforce.
- Continue reading below to learn the two methods for assigning the Affinity permission set to users:
### Option A - Assign automatically with User Access Policies
To automate the assignment of Affinity's permission set, use Salesforce's [**User Access Policies**](https://help.salesforce.com/s/articleView?id=sf.perm_user_access_policies.htm&type=5) feature by following the steps below:
1. Go to **Setup**, then search for "user" and click on **User Management Settings**. Then, turn on the toggle for **User Access Policies**.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/5.jpg" />
2. From here, click **User Access Policies**, then click **New User Access Policy**.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/6.jpg" />
3. Give it a name and a description, then click **Save**.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/7.jpg" />
4. Then, click **Edit Criteria**.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/8.jpg" />
5. From here, you can define the user criteria fill out the following two sections below, then click **Save**.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/9.jpg" />
1. **Define User Criteria**: While you can select any **Resource**, we suggest selecting "Profile" and selecting "In" as the **Operator** to include as many different profiles as you'd like.
2. **Define Actions**: Select "Grant" for the **Action** field, "Permission Set" for the **Target** field, and "Affinity_User" for the **Value** field.
6. Now, click **Automate Policy** to auto-assign the "Affinity_User" permission set.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/10.jpg" />
7. Select your preference for which event will trigger the policy assignment. If you want to automate as much as possible, we suggest selecting **when a user is created or updated**. Then, click **Activate**. Now, this policy will apply to all users moving forward.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/11.jpg" />
8. To retroactively apply the policy for existing users, you can conduct a one-time operation by clicking **Apply Policy**.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/12.jpg" />
9. From here, click the checkboxes for the users whom you'd like to apply the policy for. Then, click **Apply To Selected Users** or **Apply To All**.
<img src="/images/integrations-salesforce/how-to-installupdate-affinitys-managed-package-in-salesforce/13.jpg" />
### Option B - Assign automatically with Flow (or manually)
If you prefer to assign the Affinity permission set using Salesforce's existing features, feel free to check out the relevant Salesforce articles below:
- Assign automatically using Salesforce's **Flow** feature ([learn more](https://admin.salesforce.com/blog/2022/automate-this-automatically-assign-remove-a-permission-set))
- Assign manually ([learn more](https://help.salesforce.com/s/articleView?id=sf.assign_permission_set_to_user.htm&type=5))