2 Replies Latest reply on Apr 10, 2014 6:06 PM by c0nsilience

    License Tracking - Neophyte question


      Hey Guys,


      I'm working on a software tracking DB that will contain license keys, etc. for our company. I know this is probably a newbie question, but I'm running into a hitch with decrementing the total quantity of licenses available by "1" when a user is assigned a license. I'm using a portal to show related data from a Software Users table in the Licensing Tracking record (it's own table). I'd like to be able to assign the software key to a user and have the "Licenses Available" field show the number that remain available. I've tried some basic calculations/scripting, to no avail.


      If any of you have any suggestions, that would be much appreciated.


      Attached is what the two related tables look like.


      Screen Shot 2014-04-10 at 7.53.35 PM.png



        • 1. Re: License Tracking - Neophyte question

          Well, one way to approach this would be to have a "Total Licenses" field (number) for each product in a Product table. Then, use the related Licenses (Users) table to assign the keys. Your available licenses becomes:


               TotalLicenses - Count ( Licenses::LicenseKey )


          Another approach would be to script it, such that when you assign a new license, you decrement the available total by one. But then, you have to do a few things to lock it down:


          1) You have to make sure the fields can't be updated except through the script.

          2) You have to put in a method for cancelling / pulling back a license - again through a script - that increments the available total.

          3) You have to put in a method for manually assigning the total number of available licenses - again through a script - because you can't allow it to be manually edited.


          Sounds like a lot of work? Yeah, it is. Better to use the relational nature of the database and just let it work itself.





          • 2. Re: License Tracking - Neophyte question

            Thanks Mike!  That really helps.  Yeah, I was going nowhere fast with the scripting.


            Appreciate it!