You are viewing limited content. For full access, please sign in.

Question

Question

SQL UPDATE

asked on December 31, 2019

Hi!
I have a forms process to track student progress during therapy treatments. The form process has a lookup to retrieve data from previous therapy sessions. What is the best way to have the data revised if there was a data entry error? We need to be able to track any changes, but would like to be able to easily report the correct data. I have added a revised checkbox and a text field to document the changes needed, but I would like the read only fields to be editable if the box is checked and then fed back to the SQL database. Thanks in advance. 

0 0

Replies

replied on December 31, 2019

You will need to do a combination of steps.  You will need to build a jquery statement that upon selection of the checkbox, makes the read only field editable.  You will not select readonly in Laserfiche.  It would need to be a combo statement where upon document load, all fields are read only, unless the box is checked. 

You will need to name all your fields in the table with a css name.

$(document).ready(function () {
  $('.column1 input').prop("readonly",true);
  $('.column2 input').prop("readonly",true);
$('.cf-table-block tbody').on('click','.revise input:checked', undo);
      function undo() {
      $(this).each(function () {
        var column1 = $(this).closest('tr').find('.column1 input');
        var column2 = $(this).closest('tr').find('.column2 input');
        column1.prop("readonly",false);
        column2.prop("readonly",false);

        

 })
     }
});

If you are tracking changes, you will need an additional multi value SQL table (audit table) that would store all the previous changes, including the user updating and datetime of update, linking back to the unique id of that other table storing the info, that stores the old or incorrect changes and update the previous note column and current table with the corrections via workflow.

0 0
replied on January 2, 2020

Thank you so much! 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.