WeDid: Salesforce License Key Automation


The user has to manually assign license keys to the related software in Opportunity Line Item whenever the opportunities are closed as won.

The process involves users going into the license keys object and look for the available license key. They have to manually populate the software info into the assigned license key records as well.



Create a trigger that allows users to assign license key to the related software automatically by a button click. The solution covers:

  1. Listing out the software in Opportunity Line Item that will go through the license key assignment process. From the list, users have options to proceed or cancel.
  2. If proceed, the license key assignment process will start.
  3. In the assignment process, the trigger will search for the “Available” license key based on the type and version of the software. Once the list of available license keys has been found, one license key will be selected and assigned to the software. The software details will be populated with the assigned license key and the status of the license key will be set as “Not Available”.


Related Objects Opportunity and Custom Object
Components Apex Trigger, Visualforce
Complexity Complex