gilbenl Posted November 5, 2012 Posted November 5, 2012 Hello folks! I apologize if I have stuck this in the wrong thread, but this seemed to be the best "fit". Move as necessary. I picked up FM on the recommendation of a friend to use on a project that I am involved with. I have found FM to be pretty easy to use, and I "think" I have laid the majority of the groundwork for my project. That being said, I've found that my lack of a proper working FM vocabulary has made searching for answers impossible. So, I am going to list a few of the features/goals I would like to implement, and maybe some of you could give me a better idea of what to search for. I don't expect explicit instructions, but they're always appreciated. The project: To track delays in two preop areas, Short Stay surgery and Day Surgery. I need these two data sets to be independent, but I need to also be able to call upon both sets, when necessary, for analysis. What I have accomplished: I have created two tables, SSSU and DSU, each with identical fields. I also have created iphone layouts with logins. Everything seems to work, but I want to make it a little more refined. The following all pertain to the iphone layots, with the exception of number 1. 1) I currently have the two tables mentioned above. While they share all the same fields, they don't "talk" to each other. In other words, the data sets are independent. While for the most part I want to keep them this way, I want the ability to look at the two combined. I've read some on "join tables" but I don't really understand how to make the relationships work when all fields are the same. I also want to keep them separate as I want to create a dashboard for each, viewable by admins. 2) I would like to refine the iphone GUI. Right now, its just a bunch of drop down lists (see below). I would like it to work like this: Observer opens the file and is presented with buttons denoting observer name. Press one, and the name is autofilled for that record. Then, location is presented as two buttons. Same thing. Then, the observer is presented with the drop down menus for bed, delay, notes etc. In a prefect world, I would like to exclude the need for selecting the user. Instead, they would log in (as they have to do now anyway), and their name would be autofilled for that session. 3) Each observer will monitor multiple beds (IE: have many open records at one time). I want them to be able to go back and edit records as pts go back, but once the record is finished, I would like a "check when complete" button. When they press that, the record is committed, is no longer on their list and cannot be edited except by an admin. Thanks guys! Again, I don't expect anyone to walk me through this, but as is apparent, I don't know what to google for. Iphone_Interface_mod.tiff
comment Posted November 5, 2012 Posted November 5, 2012 I have created two tables, SSSU and DSU, each with identical fields. ... I want the ability to look at the two combined. I believe they should all live in a single table, distinguished by a Type field. I also want to keep them separate as I want to create a dashboard for each, viewable by admins. You can still keep them separate by performing a find or by defining a relationship based on Type. I would like a "check when complete" button. When they press that, the record is committed, is no longer on their list and cannot be edited except by an admin. Make the button set a Locked field to 1 (True), and allow the users to edit only when = not Locked 1
gilbenl Posted November 7, 2012 Author Posted November 7, 2012 Okay so I've successfully gotten my DB laid out, but of course, hit some more walls as my features grow a bit more complex. 1) I've made a "record complete" button with the following script attached: Set Variable [$Complete; Value:Data_MasterList::Complete+1] Go to Layout ["Splash_Home"(Data_MasterList)] When the user creates a new record, the "complete" field is autofilled with 0. When the complete button is pressed, it should change to 1, but obviously doesn't. Also, could you be more specific about where and how to lock the record? I would like to keep it viewable by the user, but locked for editing unless a checkbox is pressed. In my home menu, there are two buttons: Review Active Records and Review Committed Records. 2) I am trying to implement a very basic time clock. As this is a minor project, I can't/don't want to pay for a more advanced modular solution. To achieve this, I have created a Time Clock DB with the following fields: ID - Number - Auto-enter Serial Observer - Text - Creation Account Name User_Date - Date - Creation Date User_TimeIN - Time - Creation Time User_TimeOUT - Time User_TimeTotal - Calculation - (Placeholder) When a user "clocks in" a script runs that creates a new record in the TimeClock DB and autofills what you see above. When the user clocks out, the script is simply Insert Current Time [select; Data_TimeClock::User_TimeOUT]. When the button is pressed, nothing happens. I am sure that something is missing. The first thing that comes to mind is that if I have 5 users create 5 clock in records, how does the software know which record to call when user 3, for example, clocks out? I assume all of this is due to bungled scripts so any help would be really appreciated. Thanks again!
qube99 Posted November 7, 2012 Posted November 7, 2012 You can use a portal filter to keep the users separated. To enter the logout time you might need a Go To Record, Go To Field before inserting the time. I didn't write the example but it's very clear how it works. Current-User-Filter.fp7.zip
gilbenl Posted November 7, 2012 Author Posted November 7, 2012 You can use a portal filter to keep the users separated. To enter the logout time you might need a Go To Record, Go To Field before inserting the time. I didn't write the example but it's very clear how it works. Thanks but the portal isn't really applicable in this project as observers are not an independent table. Also, your suggestion on how to enter the logout time doesn't seem to work.
comment Posted November 7, 2012 Posted November 7, 2012 Set Variable [$Complete; Value:Data_MasterList::Complete+1] A variable is not field; you should be using the Set Field[] step to set the field's value. You can set it directly to 1, no need to add 1 to the current value. Insert Current Time [select; Data_TimeClock::User_TimeOUT]. That should work (provided the field is on the layout) - but it's always best to use the Set Field[] step which works directly on the data level. If it doesn't work, try using the debugger to capture the error. if I have 5 users create 5 clock in records, how does the software know which record to call when user 3, for example, clocks out? Each user has their own found set, and a current record within the found set. 1
gilbenl Posted November 8, 2012 Author Posted November 8, 2012 Progress...kind of... For whatever reason, set field won't do the trick. I was able to get enter text to work. I tried formatting the field as both number (which it is) and text. It doesn't work if number is selected. Here's the rub: It only works in table view when I manually select the script from the scripts menu. When I run the script in layout mode, I get error 102-Field is Missing. The field is obviously present in the layout, but is not shown in layout mode. Any thoughts?
comment Posted November 8, 2012 Posted November 8, 2012 Running a script in Layout mode makes little sense. For whatever reason, set field won't do the trick. I'd suggest finding that reason. Why don't you post your script?
doughemi Posted November 12, 2012 Posted November 12, 2012 Your script RecordComplete uses the script step Insert Text () which only works if the target field is on the current layout. Changing it to Set Field () seems to have fixed it. P.S. There is no "Splash_UserInput" layout. The RecordComplete script is called from Data_UserInput.
gilbenl Posted November 12, 2012 Author Posted November 12, 2012 Your script RecordComplete uses the script step Insert Text () which only works if the target field is on the current layout. Changing it to Set Field () seems to have fixed it. P.S. There is no "Splash_UserInput" layout. The RecordComplete script is called from Data_UserInput. Thanks for letting me know. Need to change the prefix. I know SetField() is the way to go, but it doesn't work. However, Insert Text() does. That's the reason for the question. It goes without saying that when I use SetField(), complete is set for number. When InsertText() is used, its a text field.
bruceR Posted November 12, 2012 Posted November 12, 2012 "I know SetField() is the way to go, but it doesn't work. However, Insert Text() does. That's the reason for the question." No, the reason for the question is the SetField DOES work but you do not yet understand how to use it. Since Set Field is such a fundamental part of Filemaker scripting, I suggest you focus on learning how to use it. Take a look at the modified DSU script in this updated copy. OR Tracking.fmp12.zip
gilbenl Posted November 12, 2012 Author Posted November 12, 2012 VICTORY! So I had set the complete field to autofill "0" upon record creation. The problem was that despite pressing "complete" the record still showed "0". What I didn't see was that it was in fact putting a "1" in the field, except it was leaving the 0 and putting the 1 on the line below. I changed the autofill to a blank space and it would stay blank, but put a 1 in the line below it. Finally, I tried putting clear field before the set field and it works! BruceR- Appreciate the comment, but saying I'm using "SetField" improperly and I should learn how to use it isn't very helpful. If you saw a specific misuse or could recommend further reading, that would be awesome.
bruceR Posted November 12, 2012 Posted November 12, 2012 Well, it is more helpful than saying that it doesn't work. If you don't know how to use it then that is the question you should be asking - instead of claiming that it doesn't work. Further reading would include just looking at the script step and looking at the two choices that it presents to you. There are two parts of set field: What field are you setting? ("Specify target field") What value are you setting? ("Specify calculated result")
doughemi Posted November 12, 2012 Posted November 12, 2012 It goes without saying that when I use SetField(), complete is set for number. When InsertText() is used, its a text field. It doesn't go without saying because it isn't true. The field "complete" is cast at the time it is created as number or text. Data inserted or set into it does not change the field's type.
gilbenl Posted November 12, 2012 Author Posted November 12, 2012 Attached is the "working" file. Actually, working probably doesn't need to be in quotes because everything in the main file is working. One exception is the time clock. The clockIN script works, but not clockOUT. My next big hurdle will be presenting all of this data on dashboard layouts. I really appreciate all the help, folks. As for the set field, I see that my problem may have been using an operator (=) rather than simply putting the number in the box. In the mean time, I plan to send this out to my observers to begin teasing out the bugs. I intend for them to export and send me the data from FileMaker GO. I tried this export/import using my phone a couple times and it seems to integrate into the main file on my computer without any headaches. However, if anyone knows of any "gotchas" I'm going to hit, please let me know. Thanks again for all the help!
bruceR Posted November 12, 2012 Posted November 12, 2012 The file cannot be opened. What is the account name and password?
gilbenl Posted November 13, 2012 Author Posted November 13, 2012 The file cannot be opened. What is the account name and password? Fixed 11/14. Sorry folks. See attached. Username is "public" no quotes, no password. I used it for the first time in the field this morning and everything worked surprisingly well. My next big hurdle is figuring out how to dashboard/graph the actual delays. I have a feeling the way I organized the delays will come back to haunt me. I have 5 blanks for delays, each using the same value list. Depending on the case, up to 5 delays are inserted. They are mutually exclusive and the order doesn't matter. However, when, let's say, I want to show the top 5 delay causes in a pie graph, will I be able to do this with text fields and in the format you see in the attached file?
bruceR Posted November 14, 2012 Posted November 14, 2012 Ok; the file can be opened. But it doesn't demonstrate that you've applied the effort already expended to help you. You're still using insert text instead of set field.
gilbenl Posted November 14, 2012 Author Posted November 14, 2012 Files removed, close the thread. Thanks again for the help, folks.
Recommended Posts
This topic is 4391 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 accountSign in
Already have an account? Sign in here.
Sign In Now