Jump to content
Salesforce and other SMB Solutions are coming soon. ×

OnObjectModify... false alarms


cliff021668
 Share

Recommended Posts

To whomever:

 

I'm a new member, as of about 30 minutes ago. And, this is my first post. Thx, in advance, for all the help.

 

I have a question about the OnObjectModify script trigger.

 

The Situation:

I have a layout. That layout contains (for simplicity) one radio button set, and one text field.

 

I have created a script, and attached it to the OnObjectModify event of the radio button set. This script causes the contents of the text field to be deleted.

 

(I am trying to make it so that whenever the user selects a different radio button value, the user is forced to re-enter the value into the text box.)

 

At this point in time, it works relatively well. Whenever one of the radio buttons is selected, that script does execute, and the contents of the text field are deleted.

 

However, I have noticed that the OnObjectModify trigger does not actually evaluate the user's click, to ensure that the radio button value has actually been modified.

 

That is... If the radio button is currently set to Value1, and the user (inadvertantly?) clicks on Value1 again, the OnObjectModify trigger executes. So, the contents of FieldX are deleted, even though the value of the radio button did not actually change.

 

Does that make sense?

 

Does anyone have a suggestion about how I can build that extra layer of intelligence into the script that says, "If this radio button value has not actually been modified, then do NOT execute the script"?

 

Any input would be greatly appreciated.

 

Cliff in Madison

Link to comment
Share on other sites

Welcome Cliff,

 

I haven't fiddled much with script triggers yet, but I've seen enough to say, "Way cool!"

 

I tend to think the problem you've uncovered could be classified as a bug (you might post it in the Bugs forum on FileMaker.com and see what they say). They might just say that re-selecting a value is actually opening the record again, and that's why it triggers.

 

One work-around is to store the radio value in a variable when the record loads, then compare that against the value when the OnObjectModify script runs.

 

If you upgrade your membership, you can see my example file on how this could be done.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use