Skip to main content

Posts

Showing posts from August, 2020

JavaScript to Allow Updating Specific Fields Post Record complete.

Recently for a client I was given the requirement that they needed to update a custom field on activity records whether it was a completed record or not.  The problem when a record is completed, it is in read only status and users can't update the record easily, with minimal clicks.  To solve this business requirement, I wrote two JavaScript libraries.1) UnlockFieldsOnLoad - This is the function you should list any field that you want to unlock if the record is in complete (read only status).  This function should run on load of the form and will unlock the fields so they can be updated.2) OnChangeUnlockedFields - This function is what will do the save when the field(s) are updated.  What it does it check to see if the record is in a read only status.  If if it is, it will make the record active again.  After it makes the record activate again, it will write the change to the database, change the status back to the original status and save that change. function UnlockFieldsOnLoa…