How To Check Managed Package Installation Details

How To Check Managed Package Installation Details

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

In the dynamic world of Salesforce, managed packages offer a robust way to distribute and manage custom applications and components across multiple Salesforce organizations. However, once a managed package is installed, understanding the nuances of its integration can be crucial for maintaining system integrity and ensuring optimal performance. This blog post will delve into two key aspects of managed package management: checking the installation details and exploring the associated data model.

One of the primary tasks after installing a managed package is verifying which user profiles have access to it. This includes determining which profiles the package is installed for and which ones are excluded. This verification process is essential for ensuring that the right users have the necessary permissions and that your organization's security policies are upheld.

Equally important is understanding the data model that comes with the managed package. Each managed package often includes custom objects, fields, and relationships that integrate with your existing Salesforce data. By exploring the data model, you can gain insights into how the package's components interact with your data, enabling you to optimize its use and troubleshoot any issues that may arise.

The form you have selected does not exist.

Exploring The Data Model

The PackageInstallRequest object in Salesforce is used to manage and track the installation of packages, particularly managed packages, within a Salesforce organization. This object allows administrators and developers to automate the installation process and monitor its progress programmatically. Below are some key aspects and fields associated with the PackageInstallRequest object:

Key Features of the PackageInstallRequest Object

  1. Automation of Package Installation: Instead of manually installing packages through the Salesforce UI, the PackageInstallRequest object lets you initiate and manage installations through Apex code or the Metadata API.
  2. Tracking Installation Status: By querying the PackageInstallRequest object, you can monitor the status of a package installation, check for errors, and get details about the installation process.
  3. Configuration Options: The object allows you to set various options for the installation process, such as security settings and upgrade behaviors.

Important Fields in the PackageInstallRequest Object

  1. Here are some key fields you might use with the PackageInstallRequest object:

    • Id: The unique identifier for the PackageInstallRequest record.
    • Status: Indicates the current status of the installation request (e.g., InProgress, Success, Error, Unknown).
    • SubscriberPackageVersionKey: The unique identifier for the package version being installed.
    • ApexCompileType: For  unlocked package installs and upgrades, specifies whether to require successful compilation of all Apex in the org, or only Apex within the package. Valid values are: all or package.
    • EnableRss: Boolean flag indicating whether the package can send and receive Remote Site Settings (RSS) and Content Security Policy (CSP) data from third-party websites (true) or not (false). The default value is false.
    • UpgradeType: Specifies the type of upgrade to be performed (e.g., delete-only, deprecate-only, mixed-mode).
    • SecurityType: Specifies the users for which this package is installed (e.g., Custom - Installed for specific custom profiles, Full - Installed for All Users, None - Installed for Administrators only).
    • Errors: Contains information about any errors that occurred during the installation process.

Example Usage

Here’s an example of how you might use the PackageInstallRequest object in Apex to initiate a package installation:

// Create a new PackageInstallRequest
PackageInstallRequest installRequest = new PackageInstallRequest();
installRequest.SubscriberPackageVersionKey = '04t...'; // The package version key
installRequest.Password = 'YourPackagePassword'; // If the package is password-protected
installRequest.EnableRss = true; // Optional: enable sharing rules for the managed package
// Insert the request to initiate the installation
insert installRequest;
// Check the status of the request
PackageInstallRequest requestStatus = [SELECT Status, Errors FROM PackageInstallRequest WHERE Id = :installRequest.Id];
if (requestStatus.Status == 'SUCCESS') {
 System.debug('Package installed successfully.');
} else if (requestStatus.Status == 'ERROR') {
 System.debug('Package installation failed with errors: ' + requestStatus.Errors);
}

Monitoring Installation Status

After initiating the installation, you can monitor the status by querying the PackageInstallRequest object. This is particularly useful for long-running installations where you need to check back periodically to ensure everything completed successfully.

// Query the installation request status
List<PackageInstallRequest> installRequests = [SELECT Id, Status, Errors FROM PackageInstallRequest WHERE Status = 'IN_PROGRESS'];
for (PackageInstallRequest req : installRequests) {
 System.debug('Package installation in progress: ' + req.Id);
}

Checking The Managed Pacakage Installation Details

You need to execute Tooling API Query to get the details about a package installation. Here is one example, where CPQ package is installed in one of my production org.

As you can see that this package was installed on 5/15/2024 at 9:54 AM. So now if I wanted to know the details about this installation, all I need to do is execute Tooling API query.

To execute that, I will open the workbench in another tab (https://workbench.developerforce.com/login.php). Once logged in, I will go to Utilies -> REST Explorer. Here, I will select HTTP Method as GET and execute the below query:

/services/data/v58.0/tooling/query/?q=select+ApexCompileType,ProfileMappings,SecurityType,CreatedDate,PackageInstallSource,SubscriberPackageVersionKey,UpgradeType+from+PackageInstallRequest

This will bring all the PackageInstallRequest details from the org. I will open the one where the installion date and time will match. So here is what I am getting for my CPQ installation package.

As you can see from the above image, CreatedDate matches, so this is for my CPQ installation. SecurityType is Custom, which means CPQ package is installed for specific custom profiles. So this is the way you can get details about the package installation request. 

Conclusion

The PackageInstallRequest object is a powerful tool for automating and managing package installations in Salesforce. By leveraging this object, you can streamline your deployment processes, ensure consistency across environments, and quickly identify and resolve installation issues.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

How To Debug Salesforce Flow As Different User

How To Debug Salesforce Flow As Different User

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

In the realm of Salesforce, flows are powerful tools that automate complex business processes with clicks, not code. Whether it's handling record updates, creating tasks, or sending notifications, flows streamline operations and enhance productivity. However, even the most meticulously designed flows can encounter issues, making debugging an essential skill for any Salesforce administrator or developer.

One of the critical aspects of debugging in Salesforce is testing flows as different users. This practice ensures that the flow behaves as expected for all user profiles and permissions. Debugging as different users can uncover issues related to field accessibility, record visibility, and permission discrepancies that might otherwise go unnoticed.

In this blog post, I will delve into the step-by-step process of debugging a Salesforce flow as different users. By mastering these debugging strategy, you can ensure that your Salesforce flows are robust, user-friendly, and tailored to the diverse needs of your organization.

The form you have selected does not exist.

Why Debugging A Flow Is Crucial?

  1. Ensure Functionality Across Profiles: Salesforce environments often have multiple user profiles, each with distinct permissions and access levels. Debugging as different users helps verify that the flow operates correctly for everyone, preventing disruptions in business operations.

  2. Identify and Resolve Permission Issues: Some flow actions might fail for specific users due to insufficient permissions. By simulating the flow as various users, you can identify these bottlenecks and adjust permissions or flow logic accordingly.

  3. Enhance User Experience: A seamless and error-free flow enhances the overall user experience. Debugging helps ensure that users encounter minimal issues, leading to higher satisfaction and productivity.

  4. Maintain Data Integrity: Flows often involve data manipulation. Ensuring that each user can execute the flow without errors is crucial to maintaining data integrity and avoiding inconsistent data states.

Pre-requisite

By default the option to debug a flow as different user will be disable in your org. You need to enable this feature first. To enable this feature, here are the steps :

    • Go to Setup
    • In the Quick Find, type Process Automation Settings
    • Check the option - "Let admins debug flows as other users".
    • Click on Save.

Test

In order to test this, open any flow and click on Debug. Then select the option "Run flow as another user". This will enable the option to select the user for which you want to run this flow and debug. 

Conclusion

Debugging Salesforce flows as different users is not just a best practice—it's a necessity for ensuring the reliability and effectiveness of your automated processes. By taking the time to test flows under various user profiles and permissions, you can uncover hidden issues, fine-tune your logic, and enhance the overall user experience. This comprehensive approach to debugging helps maintain data integrity, ensures seamless functionality across your organization, and ultimately leads to a more efficient and productive Salesforce environment. Armed with the tools and techniques outlined in this blog, you’ll be well-equipped to troubleshoot and optimize your flows, ensuring they meet the diverse needs of your users and drive business success.

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments

Salesforce Summer 24 Release Permissions and Sharing Enhancements

Salesforce Summer 24 Release Permissions and Sharing Enhancements

Sudipta Deb

Sudipta Deb

Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect

Welcome, Trailblazers! With each new Salesforce release comes a wave of innovation, empowering businesses and admins to unlock new capabilities and enhance user experiences. 

In this blog post, I will delve into all the permission and sharing changes that is coming up alomg with Summer 24 Release.

Watch The Video Or Read The Article (or do Both)

The form you have selected does not exist.

#1  - Summary of User’s Permissions and Access

You're in luck if you've ever wondered what queues, public groups, or permissions are assigned to a user. You may save time, effort, and clicks by viewing this information straight from the user's detail page with the help of the User Access Summary. When troubleshooting or controlling access, there's no need to run queries or go through every profile, permission set, public group, or queue.

Clicking on "View Summary" button at the user record will give you the details of user's permission and access.

# 2 - Where Public Group is Used

Find out quickly where a public group is utilized and how much access its members have without having to perform searches or navigate through numerous features. The new Public Group Access Summary allows you to view the list views that an object is shared with and the sharing rules that it is referenced in for a particular public group. Along with the other public groups it is a part of, you may view the report and dashboard folders that the public group has access to.

# 3 - What’s Enabled in Permission Sets & Permission Set Groups

Keeping track of every permission in your permission sets and permission set groups can be challenging. You can now view all enabled object, user, field, and custom permissions on a single page to simplify controlling your users' access. Additionally, you may view which permission set groups contain the permission set and which groups do not. Some improvements have been made to this feature since its beta release, and it is now generally available. We added the option to view included custom permissions and permission sets in permission set groups, and we updated the layout of the summary page.

Clicking on "View Summary" button at the Permission Set or Permission Set Groups level will show you the summary. This is very powerful feature while doing auditing.

# 4 - Automate and Migrate User Access with User Access Policies

This is a very powerful feature. Assign users automatically to public groups, package licenses, permission sets, and other access features depending on predefined criteria. Establish policies that, upon user creation or modification, automatically grant or revoke access. Alternatively, just move sizable user groups to a new access configuration in a single step. User access policies have been improved with the Spring '24 release and are currently generally available. You can now create 200 active policies, up from 20, and set the order in which active policies are run.

I have a dedicated video covering how you can configure this. Please watch the vide below.

# 5 - Update Order Field for Existing User Access Policies

The new Order column allows you to control which current user access policy is used when a user satisfies the requirements for several policies. Prior to Summer '24, active user access policies were assigned order values depending on the date of their most recent modification; nevertheless, it is advised that you modify the order values to meet your needs. Non-automated manual policies did not receive order values.

# 6 - Allow Users to Freeze Users and Monitor Login History

With the Freeze Users permission, you can now grant users the ability to freeze and unfreeze. With the Monitor Login History permission, you may also let users see and download their login history. A user with this ability can read data in Login History reports with the appropriate report permissions and access the login history related list on user records. Before, you could enable these functionalities for users by assigning the Manage Users permission; now, it has more powers. Freeze people and Monitor Login History are enabled automatically for people who are currently allocated the Manage Users authority.

After having this feature, we don't need to provide the broader permission like "Manage Users". So this is going to be a very helpful addition to the security belt in Salesforce.

Conclusion

I hope this blog post and the video will help you to understand all the new Permissions and Sharing changes that are coming up alomg with Summer 24 release. You should always review your existing org's security and take actions accordingly making sure your org is fully secured.

Stay tuned for more insights and updates as I explore the endless possibilities of Salesforce Summer '24. 

Happy Trailblazing!

Disclaimer

This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.

Comments