Jump to content

Inculing a script as part of a calculation field


This topic is 7382 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi alopas! Welcome to the Forum! smile.gif

Well, you can use a global field which your script sets (depending upon other criteria or calculations), and then that global can be used within a calculation to produce the results you wish. Without more information, I'm afraid we couldn't answer your question appropriately.

Describe what you're trying to do and why. And give us the field names (and their data types) and we'll try to help you with it. But no, you can't 'run' a script from a calculation but there are probably other ways to accomplish what you wish. smirk.gif

LaRetta

Link to comment
Share on other sites

Hi LaRetta,

Thank you wink.gif. OK ... the thing is that I made a script that is activated after clicking on a field (the script shows a message, and the outcome depends on the option selected).

As you need to click on the field to activate the script, I thought that it would be easier if after pressing "tab", the script was activated

(I'm getting lazy blush.gif ... I was hoping that I wouldn't need to write the sequence again as a calculation field)

Link to comment
Share on other sites

Alopas said...I was hoping that I wouldn't need to write the sequence again as a calculation field)

I'm unsure why you need the calculation. Depending upon what the User selects in your script Show Message dialog, what happens then? Does it set another field? And then does a calculation need to display, showing the results of this field (in conjunction with other calculation criteria)?

Why would you need to write the sequence again in a calculation field, can you explain more? The reason for using a calculation is so that it will update whenever values in a field change. Executing a script upon field exit is possible, although tricky (without a plugin). I'm unclear on what your calculation would produce or what your script does. Can you say a bit more about it? smile.gif

LaRetta

Link to comment
Share on other sites

OK, I'll be a little bit more specific: I have two FMP files ("A" and "B") with some common fields. I have a field called "X" in database "A" with two possible inputs: "Yes" and "No". What I would like to do is the following:

- If the input in field "X" (of database "A") is "Yes", then copy the info to database "B" in a new record

- If the input in field "X" (of database "A") is "No", then just go to the next record

I did it with a script, but in order to activate it I need to press a button. I was wondering the script can be activated just after selecting either "Yes" or "No" in field "X", without needing to press the button.

Thanks a lot! cool.gif

Link to comment
Share on other sites

Yes, if you make the activation of "X" part of a script. Make two invisible buttons, one covering each radio button (assuming that is what you're using) option. Have one script set the field to 'Yes' and create a new record in "B". Have the other script set the field to 'No' and continue to the next record.

Link to comment
Share on other sites

This topic is 7382 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.