
fmphysio
Members-
Posts
39 -
Joined
-
Last visited
fmphysio's Achievements
-
A text field, in which you can only enter data into in Find Mode, also has a script trigger: "OnObjectExit", which is also only run in Find Mode. When you hit Enter/Return, which is run first, the find, or the script trigger? I have a feeling it's the find, as I'm having problems avoiding fm's error when no records are found. Thanks, Unkynd
-
Hey thanks for getting back to me so quickly, I really appreciate it. I've tried the beta and I'm very happy to say it works perfectly. No jibberish in the field and no crashing. I've run it 5 times in a row now without incident. Whereas in the past I'd start to see problems on the 2nd run, and usually a crash by the 3rd or 4th. Thanks for such an making such a great plug-in!
-
I understand this is a bug with the plug-in, where Moo_FolderList() will work first time, and subsequent tries returns a garbage result or crashes FM completely. So my question is this, is it possible to set a script to restart the filemaker environment after each time you use this plugin, while avoiding the user having to log back in everytime? Or would I be better off just achieving the same thing with vbscript rather than using an unstable plugin? Thanks:)
-
Quick questions about calculations
fmphysio replied to fmphysio's topic in Calculation Engine (Define Fields)
comment, are you serious??? 9 min response time. That's amazing! Thank you so much. I'm surprised at how simple the calculations actually are. You're a fm genius! Thanks! fmphysio -
Hi all, I've got two short questions I've been thinking about recently which I'd like to run past some of you more experienced members. 1) Case(), if more than one case is true, it will display only the first. How would I calculate if I want to show all that are true separated by "/"? e.g Case(3+3 = 6; "A"; 2+4=6; "B") -> "A/B" 2) Is there a way to repeat a "word" based on another field's number/count? e.g. number = 3, text = "word word word" Thanks! fmphysio
-
OnRecordLoad - infinite loop
fmphysio replied to fmphysio's topic in Script Workspace and Script Triggers
Thanks Vaughan, I've been there and tried that.. and relationships just don't seem to cut it for what I need to do. I've managed to get around this problem of an infinite loop by enclosing the script inside an If statement, where are particular global variable ($$AllowFamilySetup = ""). Then just before the script does it's finding, i.e. switching records, I tell it to change $$AllowFamilySetup = "No". Then at the end of the script I reset $$AllowFamilySetup = "". This doesn't stop the script from triggering everytime, but does stop the script from executing the finds before it's had a chance to finish what it started. -
I have a script to get some values upon loading a Record. However, within the script are a few Find()commands. Is there a way to stop the trigger from going when ever the script finds a record? I just want it to load a record, run the script, find the records grab the values required and come back to the original record. Currently instead it loads a record, runs the script, finds a record, runs the script again, etc... Thanks B)
-
$$GlobalVariables keep changing on me
fmphysio replied to fmphysio's topic in Script Workspace and Script Triggers
:B Very sorry. I went over it and over it. I found my problem. I had set a script trigger event to grab and name the exact same variables everytime a new record was loaded. Please delete this thread, as it does not add any value. Sorry B) -
I have attached the script that I have so far. Essentially, I'm trying to set a lot of the fields from the current record and store them as global variables so other records can access them (related fields, but using a calculation field). Logically on paper this should work, but getting this into filemaker is proving difficult for me. The only variable that actually works is the $$RecID. All other variables change. What I mean is that I could start on a record with PatientID = 284, and I want $$PatientID = 284, but afte the script finishes (last line - show all records), the first record's PatientID is now stored in $$PatientID. What am I doing wrong? Thanks B)
-
Was just about to start looking into doing exactly the same thing, I would love a copy if you're still getting notifications of this threads activity. Thanks!
-
Yes totally, your solution would work for a "self" relationship. I could name someone "child or son" and that would be fine if I was looking at this relationship from the parent's perspective or even viewing the family as a whole. But what if I wanted to look only from the grandparents perspective? I want it to change to say "grandchild or grandson". With only a single word attached this wouldn't be possible. However, what I'm doing now is assigning "100" to the first person added to a new family number, and then adding relationships relative to this person, using an expanded version of the scheme listed above, where the difference in these numbers determines what the relationship is. If I get some time I'll create an example file.
-
Ahh yes, sorry.. **together**.. I did agree. Currently all patients are in the same table, it was only a passing thought that I might want to list family members that aren't part of the patient group, and I think for *that* I would want a separate table? I dunno, I easily confuse myself. I did try the whole join table between the two patient tables, and I could never get it to work as well as I'd wanted, I think I was always missing someone in the family. Although first trial of the calculation fields was successful. I'm using the following fields to figure out the relationship: FamilyID: links the records FamPosNum: family position number (any numbers 10 apart) $$FamPosNum: the current opened record's FamPosNum (linked to a script trigger that will refresh this value and the screen when the record changes) Relationship1: =FamilyPositionNo - $$FamPosNum Relationship2: =Case( Relationship = 0; "self or sibling"; Relationship = 10; "Parent"; Relationship = -10; "Child") So to include more relationships and work it better I'll just adjust Relationship2 to really figure out what's going on incorporating on the basis of PatientIDs (matching = self, not = sibling), based on sex - rather than parent have mother/father, and I might even add another field for marriages.. so you just add the PatientID of the person married to, and then instead of two people with a difference of 0 coming up as bro and sis, it would say husband and wife.
-
Thanks comment, yeah i totally agree with keeping them separate. I'm not sure if this is the correct term, but I have a self linked table? Basically two tables Patients and Familys, linked via the FamilyID field, and a duplicate of Patients called Patients_Patient_family linked to Patients via the FamilyID field. Then the portal displays related records from patients_patient_family, and all patients with the same FamilyID are listed. I'm starting to make some headway on this problem. By using a script trigger on loading the record, I can set a global variable to the current patient's FamilyPositionNumber, and using a calculation field get the difference between the Current patient's position number and the related patients number. Then with another calculation field display the relationship based on the result. So far I have this list: +20 - grandparent +10 - parent 0 - self(if ID's match) or sibling -10 - child -20 - grandchild Then obviously I'll need to create another script to set the PatientPositionNumber, based on the relationship I'd like to make. A work in progress... Thanks for all the help so far.
-
Thanks Søren for a quick reply. Yes this does work to a degree. You are assigning a "role" to each patient, such as this person is the "mother or father". And this would work if you consider you'd only ever view the family as a whole unit. This may have to be the compromise for the time being. I was hoping to take this a step further and rather than assigning a predetermined "role" to someone, have it figure out the 'role' based on which patient record is open and the related records seen in the table. For example, Dave is John's Son. If I viewed Dave's family, I would see John (father). However, if I viewed John's family, it would show Dave (son). And as these records are related to each other using a familyID, they would also see themselves (highlighted), but the relationship would be blank. How I'm considering getting around this is rather than assigning a "role" to a patient, assigning a family position number. So, for instance, parents are always +10, children are always -10. Using the example of Dave and John above, I would assign Dave (10), John (20). Then use a calculation field to subtract one from the other, and then based on the result spit out the relationship (as well as confirming the sex of the patient - mother/father, daughter/son). As these are all related by FamilyID, it shouldn't be a problem to use the same numbering system for other families. Does this seem like a good approach? If I can get this working, I'll post up the file.