Jump to content

Script trigger for conditional formatting

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

Recommended Posts

I am working in FM Pro Advanced 9 and trying to conditionally highlight a record in list view when it is the active record. I have the formatting set up so that when a global variable = the record ID, the row highlights grey. I also have written a script that sets the global variable to the record ID of the active record. However, I cannot figure out how to trigger this script every time a record is active in the layout. Basically, if I had FM 11, I would pick the "onRecordLoad" trigger, but of course, I can't do that in FM 9. Any recommendations? I know I'll probably need to use a plugin, but which one should I use and since I'm not very familiar with how they work, can you also explain how to incorporate it into the database? I used myDoScript once and it took me FOREVER to figure out where to put the calculation since the documentation is not written for newbies... Thanks in advance!

Link to comment
Share on other sites

  • 1 month later...

The zippScript plugin was a favorite back in the day, but is sadly no longer available. I don't know that there are significant differences between the free options.


What you will need is an unstored calculated field that includes the Get(RecordNumber) function, which should evaluate when you change records in the list, thus triggering your script. The actual calc will depend on which plugin you use, but probably something like:

Case( Get(RecordNumber) <> $$previous ; "" & /*plugin function here*/ )

The plugin function would specify which script to run. In the script you'd set your global variable as you indicated; in the example above I called it $$previous. Your script may also need a Refresh step (Freeze may work instead of Refresh).

Link to comment
Share on other sites

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