Here is how we can add/remove a user to/from a permission set through Apex. My requirement was to add or remove a user from a permission set when the value of a checkbox changes in user object.So I have this code in User Update After trigger.
Many people are familiar with lightning datatable component and how to use it in Aura Component. In this article I want to show example how to use lightning component in Lightning Web Component and build simple search by name and column sorting.
First we need to create an apex class.
You can create it either in Salesforce UI or Developer Console or do it in Visual Studio Code with SFDX command: