April 15, 200421 yr Hi I have downloaded the troi acrtivator plugin to trigger scripts when exiting a field. I have managed to make the following code work: External("Actr-ScheduleEvent"; "-addSingleEvent|" & Status(CurrentDate) & "|" & Status(CurrentTime) & "|" & Status(CurrentFileName) & "|Trigger Script|" & Status(CurrentRecordID) & "|Jalz") However if I wanted to run the script after 10 seconds of the field exiting would that be possible? I would also like to know if there is a way to trigger this script if the recolrd had been modified. At the moment the script depends on whether a field has been modified. Kindest regards Jalz FileMaker Version: 6 Platform: Mac OS X Panther
April 15, 200421 yr Hello Jalz, [color:"blue"] However if I wanted to run the script after 10 seconds of the field exiting would that be possible? Yes. Simply use: External("Actr-ScheduleEvent"; "-addSingleEvent|" & Status(CurrentDate) & "|" & (Status(CurrentTime) + 10) & "|" & Status(CurrentFileName) & "|Trigger Script|" & Status(CurrentRecordID) & "|Jalz") [color:"blue"]I would also like to know if there is a way to trigger this script if the recolrd had been modified. Yes. Create a time field called 'ModTime' and set it to auto-enter the modification time. Then define a stored calculation field with the formula: Case(ModTime, External("Actr-ScheduleEvent"; "-addSingleEvent|" & Status(CurrentDate) & "|" & (Status(CurrentTime) + 10) & "|" & Status(CurrentFileName) & "|Trigger Script|" & Status(CurrentRecordID) & "|Jalz")) It will trigger once, immediately after the record is exited, on each occasion when the record has been modified.
April 15, 200421 yr Author Thanks Ray, Worked a treat, the 10 second script, im going to try the modtime trigger in a bit. Just wondering if I should delete a script event (from the plugins memory) once I execute it, and if so is there a way to do this automatically? Im wondering this as at the moment, i have the trigger on all 100 fields duh- however with your modtime function, i should be able to reduce the number of times it executes. Best regards Jalz FileMaker Version: 6 Platform: Mac OS X Panther
April 15, 200421 yr Hi Jalz, Yes, you should delete the event from memory after it has been triggered. Otherwise you will eventually reach a memory buffer overflow. And yes, it can be done automatically. One way is to place a call to the plug-in as an additional step within the script which the external function is programmed to call, with the syntax: Set Field ["gResultTxt", "External("Actr-DeleteEvent", "-DeleteLastTriggered")"] Which will take each event out of memory as soon as it has been called. Unles you need to track a history of recently called events (eg for debugging purposes) then this shoudl perhaps be the first step in each script that Activator calls. Even if you do want to track events, I suggest that you have your scripts write the event ID and related details to a log field as their first step and then call Actr-DeleteEvent the above as the second step. That way your management of the memory space will be optimal.
April 15, 200421 yr Author Hi Ray, Tried the ModTime field as you decribed, it only seems to execute the script, once I click into the ModTime field (which is defined as a autoenter modified time field). Im wondering whether I should take it off the layout? In the Validated by calculation field i've typed in Case(ModTime, External("Actr-ScheduleEvent"; "-addSingleEvent|" & Status(CurrentDate) & "|" & Status(CurrentTime) & "|" & Status(CurrentFileName) & "|Trigger Script|" & Status(CurrentRecordID) & "|Jalz")) What do you think I am doing wrong? Thanking you in advance Jalz
April 15, 200421 yr Hi Jalz, If you look again at my original post, you'll see that what I was suggesting was that you place the formula into a separate stored calcualtion field. It will not work as a validation calc - auto entry options are not validated.
April 15, 200421 yr Author Thanks Once again Ray, Got it to work...I need to spend some time at the optician! My Stored calc field, Ive made it text, that should be ok presumably? Have a nice day. Jalz
Create an account or sign in to comment