Process Builder in Salesforce is a fantastic way to automate various business processes. It allows you to create a process based on certain criteria that you set. Process Builder can do many things – Create a record, Update records, Post to Chatter, Send an email, etc. A few years back – in September 2015 – I wrote an article Auto Assign package license to New user to show how one can automatically assign managed package license to new users.
The overwhelming positive feedback was followed by requests – to write another blog showing how to automatically remove managed package license from deactivated user(s)! Below is one of the sample emails – from a gentleman whom I know not, but would like thank for making the request. For, requests and ideas from my blog readers have immensely contributed towards my mastery of the Salesforce Platform!
I am looking for a way to automatically delete an installed package members whenI inactivate their User account. Currently, I have to delete the User; then delete them from the installed package. Is there a way via PB and/or Flow? I'd like an automated deletion process that captures all associations. Thank you, Erin Ryan
In this blog post, I will show you how to leverage process builder to automatically remove managed package license from the deactivated users. Let us start with a business use case.
Business Use Case
Martin Jones is working as a System Administrator at Gurukul on Cloud (GoC). At GoC they are using Conga Composer to streamline and scale their document generation process and Resco to use true offline mobile capability for their Sales and Field Service reps. Martin received a requirement from the management to auto remove managed package licenses as soon as a user’s account is deactivated.
Solution for the above business requirement
Before we proceed, let us first ponder – why do we need to automate this process in the first place?
On AppExchange, App providers use managed package, partly, to hide the code and implementation logic from customers. Another benefit of a managed package is that app providers can easily push updates to their customers’ org in one stroke.
When a user’s account is deactivated is Salesforce, his/her Salesforce license is released and available for reassignment. Such is not the case vis-a-vis the deactivated user’s managed package license. For despite being deactivated, a user’s managed package license is not automatically removed from his/her account; the System Administrator has to manually remove managed package license from the deactivated user’s account.
There are a few possible solutions for the above business scenario, but we’ll use Flow and Process Builder to solve the above business requirement. Before trying to understand the technical aspect of the solution, let us spend some time to understand the general flow of our solution at a very high level. Please spend few minutes to go through the following flow diagram and understand it.