AnsweredAssumed Answered

Scripting error/bug inserts text in wrong field

Question asked by mJn on Apr 13, 2012
Latest reply on Apr 13, 2012 by philmodjunk

Title

Scripting error/bug inserts text in wrong field

Post

Hello FMP users.

I have a database in which records are lockable via a LOCK FLAG field (set to = either "LOCKED" or "EDIT"). This field itself is visible as a radio button with text coming from a VALUE list.

I have custom privileges set so that records can only be modified/edited when LOCK FLAG = "EDIT".

This almost works except the radio buton itslef is also locked when the record is locked...therefore I cannot use the radio button to unlock the record (a solution to this woudl be most helpful!)

As a work around, I created two buttons: "LOCK" and "EDIT" that each trigger a script that states:

LOCK - Insert Text [Select; Table name::LOCK FLAG; "LOCKED"]

EDIT - Insert Text [Select; Table name::LOCK FLAG; "EDIT"]

Until recently these worked perfectly. 

Now, after simply editing the layout of the database, the same scripts write "LOCKED" or "EDIT" into one of the other fields (one with data in it!). And they no longer cause the LOCK FLAG to change!

I have remade the script and it still keeps doing this. Old copies of the database are fine UNTIL I enter the layout mode. Upon exiting the layout mode (after perhaps double-clicking on any one of the fields to view the data it is pointing to), the scripts continue to be corrupted permanently.

I am flummoxed. It looks like a FM bug to me. I see the same problem when running the database on FMPro 10 and FMPro 11.

Any suggestions? The field that is getting overwritten is a VERY IMPORTANT text field so I can't scrap it. Would it be safe to duplicate it and rename somehow? But how can I then make the script modify the correct field?!?

Or if there is a way to resolve the radio button being locked (i.e. a way to keep that button permanently unlocked), that would be a way to avoid scripting entirely *but that doesn't solve the bug!

Hoping for some help! Matt

Outcomes