Stefan Djurcic Posted November 2, 2012 Posted November 2, 2012 Hey there! Im new to this forum and with Filmaker Pro. Im currently still watching some tutorials I grabbed from lynda.com My boss wants me to make a database for incoming calls to the office, where when someone calls, we launch the database and start entering information about who called, when, what they said, etc etc. I think making this is fairly simple, just make the appropriate fields right? But the key thing he wants from me is to make the database so that you cant continue to enter data into the next fields until you've inputed something in the given field. Kinda like popup messages: Type First Name, then Type Last Name, then Type What they said, etc. So you cant move on to enter data into the next fields UNTIL you've filled in the field you are first presented with. Is this possible to design with Filemaker Pro 12? Can someone please explain to me how? It would be very appreciated! Thank you! ps. sorry if Im posting in the wrong section here I just figure this would be something customy :P
jbante Posted November 2, 2012 Posted November 2, 2012 Reading between the lines, I'm guessing that the bigger issue is ensuring that users enter all the required data. Requiring previous fields to be populated before entering later fields can lead to a bad user experience. I would suggest that you first try some attention-grabbing conditional formatting on the fields that require data so users can see for themselves what data are still needed and exercise their own judgement in filling the fields. For each field that's required to have a value in it, set the conditional format to activate by calculation with "IsEmpty ( Self )", and make the background color something distinctive (coloring it red is a favorite) when the field is empty. If the fields really have to be populated in order, you're probably looking at script triggers. First, set the tab order to match the order you want the fields entered by entering layout mode on your data entry layout and selecting from the Layouts menu > "Set Tab Order..." Next, create a script (perhaps named something like "Enforce Data Entry Order OnObjectEnter") like so: If [not TriggersAreActive // make triggered script suppressible per FileMakerStandards.org best practice ] Exit Script [] Else If [Get ( ScriptParameter ) = True] Go to Previous Field End If For each field on the layout where you want to enforce the data entry order, set up a script trigger (Right-click on the field, or select it then go to the "Format" menu > "Set Script Triggers..." Select the OnObjectEnter trigger, and select the script you just made. At the bottom of the dialog where you select the script, make a parameter calculation like so: IsEmpty ( Table::field1 ) or IsEmpty ( Table::field2 ) // etc... The list of which fields you check will be different for each field you're attaching a trigger to. The first field in your entry order doesn't need the trigger at all, the second field should only check the first field, the third field should check the first two, etc. This way, if a user tries to enter field 3, but field 2 is empty, the script parameter will evaluate to True (1), and the script trigger will skip the user back to the previous field in the layout's tab order. If you want to make the user interface extra annoying, you could include a beep in the script trigger, or even a Show Custom Dialog step berating the user for doing it wrong. If you want to be super annoying (and create a situation that's more difficult to debug), you could make an OnObjectExit trigger that prevents the user from leaving a field they need to populate until it's populated. It's possible for that to get into a nasty loop with the previous trigger without being very careful about how both of them work, so I wont describe how to do that unless someone expresses that need.
comment Posted November 2, 2012 Posted November 2, 2012 If the fields really have to be populated in order, you're probably looking at script triggers. Perhaps I am missing something, but why not simply script the entire data-entry process as a series of Show Custom Dialog steps? In v.12 you could make it a bit more fancy, but still using the same principle.
David Nelson Posted November 2, 2012 Posted November 2, 2012 I like both ideas. here is what i thought. Maybe name the fields object 1, 2, 3 etc. and somehow know max number maybe onLayoutLoad set max to $$max variable then Script on object exit of If [ $$n < $$max ] Go to object [ Let( $$n = $$n + 1 ; $$n ] Else Halt End If It should force them in order. But then I am new so probably not best or these great developers would have recommended it. Still, it may have potential. Maybe it should be on validation instead. And what if they need to go back to fix something?
Stefan Djurcic Posted November 2, 2012 Author Posted November 2, 2012 Thanks a lot for your feedback and help Jeremy! I had to read this through several times to get whats going on. I just started using FileMaker so Im really newbie I first made the custom function TriggersAreActive which I got from http://www.briandunning.com/cf/1247 I dont get it, is the whole function just this one line? not $$~DISABLETRIGGERS Seems kinda small but ok , if thats what it is. I like things short and sweet anyway I then clicked on the second field and set up a script trigger ->checked OnObjectEnter->clicked + button -> type "Enforce Data Entry Order" as the name ->copied your script from above (wasn't actually as simple as copy+paste but I found my way around with the left side options Then in the "Optional script parameter:" I clicked Edit-> IsEmpty ( Untitled::First Name ) IsEmpty ( Untitled::Last Name and Untitled::First Name ) for the 3rd field is it? Do you want me to send you my filemaker file so you can take a look at what Ive got so far? It would be of great help. Im newb at this program and my boss already assigned me to some more advanced work for my level, so it would be very helpful of you or anyone on this forum to get me in the right direction here. Basically, he explains to me what he wants like this: someone calls the office-> we launch this filemaker file and a window pops-up asking you to type in the first name and last name of the caller. -> you hit enter and then a second window pops-up with 5 fields where you enter what the convo was about. he says he wants it so at least 1 field is filled in before continuing -> then the 3rd window pops up asking you to type data in a TO-DO field.->4th window: a deadline field-> 5th window: set alarm to go off on all our 6 Macs in the office alerting us about the call info. …ya a handful for a newb I know, but I need at least some guidance on this undertaking. first of all, is this even possible? with the window popups? I haven't seen any popping up windows yet but I have no clue lol Thanks again! -Stefan
jbante Posted November 2, 2012 Posted November 2, 2012 The Triggers* custom functions are designed to work together as a set. The TriggersAreActive function really is that simple; but we still wrap it in a custom function so that if we ever change how it works, none of the scripts that use it will be broken — there's only one calculation to change in the custom function definition instead of a separate calculation for each triggered script. It sounds like you have a learning experience ahead of you. I'd be happy to glance at your file if you get stuck on something. I doubt that the multi-screen workflow your boss wants is a good idea — the same information on fewer screens would almost certainly be better — but it's all possible. Read the documentation for the New Window [] script step. The part that may be most unintuitive to implement may be triggering an alarm on the other workstations, which is deserves a thread to itself.
qube99 Posted November 3, 2012 Posted November 3, 2012 I think a simple field validation might work. You won't be able to go to any other field until the selected one has a valid entry.
comment Posted November 3, 2012 Posted November 3, 2012 I think a simple field validation might work. You won't be able to go to any other field until the selected one has a valid entry. What is the "simple field validation" that will do what you describe?
qube99 Posted November 3, 2012 Posted November 3, 2012 What is the "simple field validation" that will do what you describe? In Manage Database > Fields select a field and click Options and then select the Validation tab. There is a nice variety of validation methods available. The simple ones are very plain. For more complex validation try the user manual or FTS 12. You can validate for just data, or properly formatted data, or data of specific types or data in specified ranges or data that meets more complex scripted criteria. When validation fails you get a warning message. You cannot exit the field until it passes validation or you delete the record. For instance, in a first_name field you might set field validation to pass if there is text in the field. It's really pretty easy to learn field validation.
comment Posted November 3, 2012 Posted November 3, 2012 Thank you, but my question was what kind of validation can you set up so that "you won't be able to go to any other field until the selected one has a valid entry".
qube99 Posted November 3, 2012 Posted November 3, 2012 Thank you, but my question was what kind of validation can you set up so that "you won't be able to go to any other field until the selected one has a valid entry". To get started try selecting Not Empty validation on a text field and test it out.
comment Posted November 4, 2012 Posted November 4, 2012 (edited) I am afraid you are still missing the point. Validating a field as 'Not empty' does not prevent you from exiting the field while it's empty. More to the point, it does not force you to enter data into another field first - which is what the OP wants. Edited November 4, 2012 by comment
qube99 Posted November 4, 2012 Posted November 4, 2012 Yeah, you'll need some scripts to force a specified sequence.
LaRetta Posted November 4, 2012 Posted November 4, 2012 qube99, you just go in circles with generalities and we are back at square one. :^) You say it is 'simple field validation' but you have not provided an example of how YOU can make this work. We all love learning new things so if you know how to do please create a simple small demo file so we can learn too.
qube99 Posted November 4, 2012 Posted November 4, 2012 qube99, you just go in circles with generalities and we are back at square one. :^) You say it is 'simple field validation' but you have not provided an example of how YOU can make this work. We all love learning new things so if you know how to do please create a simple small demo file so we can learn too. Sorry. I first showed him where field validation was located and suggested he look at it and maybe read the user manual or FTS 12 for more information. Then I suggested he click the Not Empty button in field validation and see if that does the job. At a minimum he'll get some ideas to work with and we can get more complex (scripted validation) if needed. Not sure how I could have been more specific in describing this simple (click 1 button) field validation.
Vaughan Posted November 5, 2012 Posted November 5, 2012 qube99, why not put together a simple demo file that illustrates how field level validation will solve the initial problem. 1
Stefan Djurcic Posted November 5, 2012 Author Posted November 5, 2012 How can I make this (my boss wants exactly this and nothing else...): I launch my filemaker database file and the first thing I see is a box with the message "Enter First Name" and a text field to input the data. So I type a name in and then when I hit Return a new box shows up in place of the old one with the message "Enter Last Name". and so on and so on. How is this achieved? Is is possible? Im new to Filemaker so I haven't got a clue of all its capabilities or disabilities Thank you!
comment Posted November 5, 2012 Posted November 5, 2012 I believe this is the same question you asked here: http://fmforums.com/forum/topic/86607-help-design-question/
Stefan Djurcic Posted November 5, 2012 Author Posted November 5, 2012 kinda ya, but i still didnt get an answer for it. and this is different. its a box, not a popup window. please an answer, thanks!
comment Posted November 5, 2012 Posted November 5, 2012 My answer is the same as before. If you don't want to use a custom dialog, you can use a global field and let the script pass the entry to the appropriate field at each stage.
Raybaudi Posted November 5, 2012 Posted November 5, 2012 Another way could be to use a scripted tab control, more easy on 12 than on any other version.
Lee Smith Posted November 5, 2012 Posted November 5, 2012 I have merged your two topics. Please do not multiple post your questions. If you have additional thoughts or questions about the same problem then continue to ask on the original topic. Do not splinter your topic for this purpose. If you have any questions, then send me a private message. Lee
qube99 Posted November 6, 2012 Posted November 6, 2012 Comment's global field/scripted method would be quite elegant. How would you get the Return keystroke to trigger the script? I'll try to post up my original idea tomorrow.
comment Posted November 6, 2012 Posted November 6, 2012 How would you get the Return keystroke to trigger the script? it would resume a paused script, not trigger it.
qube99 Posted November 6, 2012 Posted November 6, 2012 In C++ I would test the CIN stream for a Return using If or While. Just curious how one might detect a Return (or any other character) in an FMP input stream. It wasn't covered in FTS 9 and I just barely started FTS 12. Seems like a pretty useful thing to know.
jbante Posted November 6, 2012 Posted November 6, 2012 Qube, to trap for a particular keystroke, you'd use an OnObjectKeystroke or OnLayoutKeystroke script trigger to call a script. Within the script, you can use Get ( TriggerKeystroke ) to find out what keystroke triggered the script. "Code ( Get ( TriggerKeystroke ) ) = 10 or Code ( Get ( TriggerKeystroke ) ) = 13" will return True (1) when the user keys a Return or Enter. (I can never remember which is which.) Be careful using these script triggers — they will intercept *all* keystrokes not trapped by the OS or FileMaker itself, and they can stop keystrokes from being passed through to the interface (such as to enter text in a field) depending on what result is returned in the Exit Script [] step. (Return True (1) to allow the keystroke through to the interface, or False (0) to stop it.) You didn't read about it in the FileMaker 9 certification study guide because FileMaker 9 did not have script triggers, which were introduced in version 10. I agree that the scheme Comment described may be easier to implement with a paused script, but a triggered script could be set up to have the same effect — you're not crazy.
qube99 Posted November 6, 2012 Posted November 6, 2012 That knowledge would certainly change my approach. The jump from 9 to 12 is a big one. I can barely wait to complete my training in 12.
Recommended Posts
This topic is 4467 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