Avatar

Correct answer by
Level 10
  1. Open my  form in Designer.
  2. Highlight one of the fields that gets locked.
  3. In the script editor (above the form design but below the menu items) in the top left is a dropdown labelled Show. This is a dropdown that shows all of the events that this object supports. Anything that has code will have an asterix beside it. In our case th eexit event will have code.Choose the exit event and code will appear in the script window.
  4. Highlight all of the code including the if and endif statements (do not pick the 1st line that has form1.#subform .......). Copy this code to the clipboard
  5. Now open your form. We need to change the default language to FormCalc instead of Javascript
  6. Under th eFile/Form Properties/Deafults menu in teh middle of the screen make sure that the Default language is set to FormCalc and not Javascript and make sure that the Default Run At is set to Client (it shoudl be by default)
  7. I assume that you are doing something similar where you have a field and the Log Time beside it.
  8. Make sure each field and corresponding time set log field has a unique name.
  9. Now kighlight the 1st field you want to lock down.
  10. In the script editor choose the exit event (like we did before)
  11. Place the cursor after the 1st line in teh script editor and paste the code that is in the clipboard into the script editor.
  12. NOw we need to modify the script to point to your object names. I have pasted a version of the code below .....teh part in red is the name of my object ...you need to modify it to point to your object names. Thats it.

  

if ($.rawValue <> null)then

Log1.rawValue

= Num2Time(Time(), "HH:MM:SS")

$.access

= "readOnly"

endif

View solution in original post