Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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

Posted

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.

This topic is 5980 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.