Need better method for field level security-bug erases my line items
The method I chose to secure a "posted" invoice was when a field Invoice::Lock is set to "0", then trying to enter any editable fields will trigger and On Object Enter script which simply takes the cursor to another field, making it impossible to change the quantity, item or customer information.
It would show a quick flash when the user tries to enter/change data but would effectively prevent changing info once the invoice is marked paid.
The invoice info displayed is from the line item table.
On a "posted" invoice, I found a bug by accident that if I place the cursor in Qty and hit any other key, the character or number chosen will actually add itself to a merge field that contains the invoice number (if invoice ID was 295 and I hold Qty after it's posted and enter the letter "Y" the merge field will change to 295Y). This field is set up as a serial with unique ID and not modifiable.
The next click into the Qty Field will erase all the line item entries on the invoice. Looking into the line item table, the entries including Qty., Item, Description, Price, and Extended Price are all still there. Very strange.
I believe the solution for this is going to be a better way to prevent data from being changed but I haven't found a conditional way to change access in browse mode once my Invoice::Lock field is changed to the "lock" mode.
I'm less concerned with the bug if I can just make it so that those critical fields are made not changeable after it's marked "posted".