January 11, 200718 yr Hi - I need to have a field based on a calculation which is updated but the calculation is multi-step and requires a script. It's pretty simple - just need to do a find and figure out the relative position of the current record in the found set. But as records are added/deleted this will change, so I need this to be updated appropriately. I'm sure this is a common thing - but I can't figure out how to do it. The script is trivial, but how do you tie it to a field or calculation that will update automatically rather than when a script is activated by the user? Thanks! Michael
January 11, 200718 yr :idunno: I don't get the riddle; wanna give us some clues as to SPECIFICALLY what you want? BTW, I deleted your duplicate post. It isn't necessary in FM Forums. Everyone does it when new so don't feel bad but I wanted to let you know. And if you give us some information to work with, we can address you problem. LaRetta
January 11, 200718 yr Author Hi - So - I have a visits table that tracks doctors visits. There are related tables for procedures done at the visit (related by procedure ID) and who the patient was (related by patient id). For certain procedures, I need to know if I've hit a certain threshold number of those visits, as an expense calculation will change based on the number of visits. So - the algorithm is simple - find all visits with same procedure and same patient. Determine current visits relative place in that found set (eg 5 of 27 visits). If 5 < critical number, do one calculation. If 5> critical number, do something else. But if records are deleted, then visits that were previously over the threshold count now may be under it - so it needs to be updated whenever that count changes. Short of telling user to press a button everytime they need this information, I'm trying to figure out how to have this algorithm execute automatically, so that the field dependent on it (an expense related field) will always be correct based on the current number of visits. If a calculation field could "call" a script this would be easy - is that possible? I have FM 8.5 Advanced, so I have the developer functions. Thanks, Michael
January 12, 200718 yr It doesn't sound like you need a script to calculate what you want. You could just use a calculated field to come up with the result, then it would change automatically. But if you really do need to have a script invoked from a calculation, it is possible. Try the EventScript plugin, it's free. http://www.softs4humans.com/index_en.html
Create an account or sign in to comment