ayman Posted July 10, 2008 Posted July 10, 2008 Hi all I don't know if it is possible or not but I want to run a script when i go to a different record but not necessary changing record contents (this means zippscript plugin with validation calculation is out of the question). This means every time i view a different record in a form view a script will happen. Is it possible Thx
Lee Smith Posted July 10, 2008 Posted July 10, 2008 What do you want the script to do when you change records? IMO, zippscript, etc. are usually thought of in connection with running scripts when entering or exiting fields. Without more information about what you are trying to do, we would be guessing. Lee
Tim W Posted July 10, 2008 Posted July 10, 2008 Hi Ayman This means every time i view a different record in a form view a script will happen. Trigger on record change and not layout change? How many ways do you allow a user to get to another record? buttons, menu, etc. Reason for question is if the the options are limited you could control movement. Say navigation is by next/prev buttons, you could attach a perform script step to your navigation scheme. With a method like this you would have to lock down record to record navigation, but it would work. HTH, Tim
ayman Posted July 10, 2008 Author Posted July 10, 2008 probably it is the only possible way to do it i was hoping there are other ways
Tim W Posted July 10, 2008 Posted July 10, 2008 What you are trying to accomplish is navigation driven, so the trap/trigger has to be navigation driven as well. Sorry, but I know no other way to trigger a navigation event. Tim
comment Posted July 10, 2008 Posted July 10, 2008 It should be quite easy to trigger a script on navigation by a calculation that re-evaluates on screen refresh - such as an unstored calculation field, or a web viewer, or a conditionally formatted object. The trickier part is NOT to trigger the script on every screen refresh - this could be controlled by a variable.
Tim W Posted July 10, 2008 Posted July 10, 2008 Comment, Good, how would it look? Global unstored calc set to Get(RecordID)?? I have tried to do this kind of thing to test for required fields (left blank)in the past? Any ideas on the best way to do this kind of test? Tim
comment Posted July 10, 2008 Posted July 10, 2008 There's no such thing as "Global unstored calc" - global calculations are stored. You need an unstored calculation. Take a look at the attached file - it uses a calculation field, but as I said, a web viewer or a conditionally formatted object could be used just as well. Note that I do not use plugins routinely, so the precautions I took against unwanted triggering may NOT be adequate. Use at your own risk. NavigationTriggeredScript.fp7.zip
Tim W Posted July 11, 2008 Posted July 11, 2008 Case ( not Get (WindowMode) and $$serialID and $$serialID ≠ SerialID ; Let ( [ $$serialID = SerialID ; script = mFMb_DoScript ( "MyScript" ) ] ; "Script ran at " & Get ( CurrentTimeStamp ) ) ; Let ( $$serialID = SerialID ; "Nothing happened at " & Get ( CurrentTimeStamp ) ) ) not Get (WindowMode) = works in browse mode only and $$serialID = works only after first pass thru the calc and $$serialID ≠ SerialID = tests for key field change Do I understand this correctly? I like this, but as you noted a plugin is requred. Which is not a problem for me. I am just trying to grasp the logic and want a confirmation. In actual implementation when would you clear the $$Serial, or is it o.k. to leave it be. Thanks, Tim
comment Posted July 11, 2008 Posted July 11, 2008 not Get (WindowMode) = works in browse mode only and $$serialID = works only after first pass thru the calc and $$serialID ≠ SerialID = tests for key field change Do I understand this correctly? Yes, except the last one tests for moving to a different record. There's no relationship involved here, hence no key field. In actual implementation when would you clear the $$Serial Probably only when the file is closed. Note that you must be careful not to use the same variable name elsewhere. Also, if you want to implement this in other tables, you'll need a separate $$variable for each. Perhaps there is a more elegant method to handle this, but as I said I haven't really looked into using plugins.
Recommended Posts
This topic is 6324 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 accountSign in
Already have an account? Sign in here.
Sign In Now