- Click Setup.
- In the Quick Find box, type Permission Sets.
- Select Permission Sets, then click New.
- Label the Permission Set then press the tab key, the API Name will auto-populate.
- Click Save.
Step 2: Create a Record- Triggered Flow to Assign Permission Set at the time of User Creation. Step 3. configure the flow as follows:
- Trigger the Flow When: A record is created
- Run Flow: A record is created
- Object: User
- Set Entry Conditions
- Select All Condition Are Met (AND)
- Set Conditions
- Field: User | IsActive
- Operator: Equals
- Value: {!$GlobalConstant.True}
- Click Done.
Step 4: Adding a Get Record Element to Find Permission Set Id:
- Under Toolbox, select Element.
- Drag-and-drop Get Records element onto the Flow designer.
- Enter a name in the Label field; the API Name will auto-populate.
- Select the Permission Setobject from the dropdown list.
- Select All Conditions Are Met (AND).
- Set Filter Conditions
- Field: Name
- Operator: Equals
- Value: Tetsing_User
- How Many Records to Store:
- How to Store Record Data:
- Click Done.
Step 5: Create Records — Add Permission Set to New Users
- Under Toolbox, select Elements. Drag and drop Create Records onto the canvas.
- Input the following information:
- Enter Label the API Name will auto-populate.
- How Many Records to Create: One
- How to Set the Record Fields: Use separate resources, and literal values
- Object: PermissionSetAssignment
- Set Field Values for the Permission Set Assignment
- Row 1:
- Field: AssigneeId
- Value: {!$Record.Id}
- Click Add Row
- Row 2:
- Field: PermissionSetId
- Value: {!Find_Permission_Set_Id.Id}
- Click Done.
- If you want to Remove Permission Set from the Assigned User then you will need to set the Expiration Date.
- Create the Variable.
- Set the Variable type Formula.
- Set the API Name date.
- Select Data Type as Date/Time and Set the Formula of the Expiration Date NOW() + Adding No of Days according to the requirement .
- Row 2:
- Field: ExpirationDate
- Value: {!date}
In the end, Flow will look like the following screenshot:
perform the steps below:
Originally published at http://amansfdc.wordpress.com on November 6, 2022.