Assign License on Team Member Addition

Managed Package Licenses are required for users to have access to Distribution Engine tabs and fields and for Auto-Action to occur. These steps will allow you to create a process builder flow that will add a managed package license when a user is added to a team.  This is a two part process that starts with Creating a Flow and then Creating a Process Builder process. 

Creating the Flow

The first step in the process will be to create the flow that will be used in your process builder. This flow will lookup the Distribution Engine package License ID, verify if the user already has a license, and assign if they do not. 

Images can be clicked on to enlarge

1) Navigate to the Flows section by going to Setup and searching for Flows

2) Create a New Flow, Navigate to the Resources tab, and double click the Variable option. 

3) We will create 3 varialbes. One will hold the Distribution Engine License Id, one will hold the UserId passed from your process builder, and one will be used to determine if the user has a license already.

 

 

 

4) Navigate back to the Palette tab and drag and drop the Record Lookup data step to your design canvas.

5) The first Record Lookup will be to get the Managed Package License ID. 

  • Choose a name for this step
  • Set the Look up object to PackageLicense
  • Set the Field Criteria to be NamespacePrefix equals n2de
  • Assign the Id field to the n2de_PackageLicenseID variable previously created

6) Drag a second Record Lookup data step to your canvas. This one will be used to determine if the user already has a license.

  • Choose a name for this step 
  • Set the Look up object to UserPackageLicense
  • Set the Field Criteria: 
    • PackageLicenseId equals n2de_PackageLicenseID
    • UserId equals n2de_UserID
  • Assign the Id field to the has_license variable previously created
  • Check the "Assign null values to the variable(s) if no records are found" option.

 

 

7) Drag and drop a Decision logic step to your canvas. 

8) Configure the decision.

  • The first outcome will be "Yes" and will look at the has_license variable to see if it does not equal null (value is left blank.)  
  • The default outcome can be named "No" and will be the default outcome if the user does not have a license already assigned to them

9) Drag and drop a Record Create step to your canvas:

10) Configure the Record Create step:

  • Choose a name for this step
  • Set the Create object to UserPackageLicense
  • Set the field values we'll be setting:
    • Field: PackageLicenseId     Value: n2de_PackageLicenseID
    • Field: UserId     Value: n2de_UserID

11) Link everything together

  • Make sure the first step (Record Lookup DE Managed License ID) is marked as the starting element
  • Make sure to choose the "No" action (Default Outcome previously named No) when linking the Decision to your Record Create

 

12) Save your flow and activate it

 

Create the Process Builder Process

Once you have the flow created, you'll need to tie this in to a Process Builder process. 

Images can be clicked on to enlarge

1)  Navigate to Setup / Process Builder

2) Create a New process builder process

  • Set the process to start when a record changes

 

3) Click the + Add Object section and choose the object to start the process

  • The object is Distribution team member
  • only when a record is created should be selected for when to start the process

4) Click the + Add Criteria option

  • Name the critera anything you'd like
  • Set the Criteria for Executing Actions to No criteria-just exxecctue the actions!

 

5) We're going to create this as a Scheduled Action due to certain update types not being able to occur at the same time.

  • Click Set Schedule
    • Set to 0 days after CreatedDate

  • Click +Add Action in the Scheduled Action section
    • Action Type = Flows
    • Name the action anything you'd like
    • Flow = The flow you created in the first part of this tutorial (a drop down is provided)
    • Set Flow Variables
      • Click + Add Row
        • Flow variable = n2de_UserID created in the first part of this tutorial
        • Type = Field Reference
        • Value = selecct n2de__User__c 

 

6) Save the action and Activate the process

It may take a few minutes before the license is actually assigned to the user as this is done as a scheduled action. 

 

 

 

How did we do?

Assign License and Permission Set on Team Member Addition

Tasks on Record Assignment by Distribution Engine

Contact