Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Alex117

  • Rank

Profile Information

  • Gender
  1. Thank you, that can be a possible alternative. Let's see if anyone else has a bright idea. I wish there was a way of doing this without having to click additional buttons, by just retaining the default drag and drop option openly on the layout. If there could be a way to trigger a dialog box, upon the user attempting to modify the field contents, and presenting the choice to either commit changes to the field or not it would be great. I'm not fully certain if there's a workaround to this yet seeing as the current drag and drop behavior is finicky regarding script triggers and ignores certain rules. I found this message on the FileMaker website discussing the same topic: "Testing department informed me this issue has occurred for a long time and is a design limitation. Auto-commit occurs when dragging a file from outside FileMaker Pro into a Container field when the record is not active (not being edited)."
  2. Actually, it DOES seem to work. But, only with the "OnObjectModify" script trigger set on the field. If you drag and drop a file into a container field, even without having clicked into the field, it will still trigger any script defined in the "OnObjectModify" script trigger. See my attached sample file. Container Field - OnObjectModify script trigger - drag and drop test.fmp12
  3. Hi, everyone. I need help creating a script to trigger when a Container field is modified, as in existing contents is replaced or deleted. I would like a custom dialog box to prompt the user if they really want to modify the Container field which has already been populated with content. If they select "OK", the changes are made, but if they select "Cancel", the changes are not made to the Container field. The reason this came up is because I want to prevents accidental delete or replace of a container field's contents via the "drag and drop" feature that FileMaker has. A user can easily hit the delete key while resting on the field or drop a new file onto it without considering the effects that the existing data will be gone forever. Since these container fields will hold important documents and information, I would like to add some pre-emptive warning measures on the user's side. I believe this can be done via the "OnObjectModify" script trigger on the actual container field, but I've had no luck testing scripts steps. Also, I discovered that if one drags and drops a file onto a container field, the field is automatically committed, so the changes becomes final instantly. So, using the "OnObjectEnter" and maybe other available triggers might not work exactly as expected in this scenario due to the default "drag and drop" functionality committing all changes instantly. I also prefer to leave the "Save record changes automatically" option for the layout enabled. I know that leaving this unchecked will prompt you after exiting each field if any changes made should be saved, though even with this option uncheck the "drag and drop" behavior of container fields bypasses the default FileMaker warning message and allows you to overweight the existing content of the container field. I believe this is because the container field is never actually entered or exited, since a file is just dropped onto it to overwrite any existing one, and as mentioned above the changes are committed instantly. Now, if you actually do enter the container field, by selecting it, then the warning message triggers just fine.
  4. So in this particular case since there is only one button I don't really need to know which button was selected in order to continue with the rest of the script, right? I've seen cases where there are two buttons and the use of Get ( LastMessageChoice ) becomes apparent. For example, a "YES" and a "NO" button. If the user clicks "yes" some specific script steps need to be performed, if they click "no" instead a different set of script steps are performed. Since there is only one button in this case, and only one outcome, there is no need to use the Get ( LastMessageChoice ) step, correct?
  5. Thanks Brooks, that worked like a charm! I also noticed that just placing a simple Halt Script step right after the second and final Go to Field step also managed to fix the issue, fully stopping the main script and preventing it from recurring indefinitely (interestingly, an "Exit Script" step on the other hand will not stop the loop). I guess it has something to do with entering a field, exiting that field, and then entering that same field again shortly after, which in return causes the script to get hung up. Thank you David, that sounds like a good option as well (since pop-up dialogs can sometimes be a little obtrusive to some users).
  6. Hi, I had a simple question that had recently come up in my scripting. When writing a script that contains a Custom Dialog with just the default "OK" button and no other buttons, is it necessary to use a Get ( LastMessageChoice ) script step right after to properly close the dialog and perform the next action? Or is it okay to just write the rest of the script steps that follow, right after the Custom Dialog step, without getting the last message choice? Since there really is only one button choice presented to the user and not multiple outcomes. Thanks for any insight! Bellow is a sample script with this scenario: # Show custom dialog with only one button ("OK" button with "Commit Data" checked). Show Custom Dialog [ Message: "Please click "OK"."; Default Button: “OK”, Commit: “Yes” ] # # Perform the next script step (without getting the last message choice). Go to Field [ ]
  7. Greetings, I have a global field that is acting as a search bar to perform a find with the data stored in it. I have set an OnObjectKeystroke script trigger to the field to activate a script if the user presses the enter key while inside the field. Since most users are used to hitting enter on their keyboards to perform a search and it's much quicker, I've adopted this method as opposed to a search button. I would like to prompt the user with a warning dialog if they press enter while inside the search field, but happen to leave the field empty. The custom dialog would tell them to type some search criteria in, instead of leaving the field empty to avoid performing a blank search. So far most of the script I came up with works, but for some reason it gets stuck in a loop during the last simple steps and I can't get out of it. I'm trying to have the following occur: - Exit the search field, and make it lose the focus. - Show a custom dialog telling the user of the error and prompting them to press "OK". - Upon pressing OK, enter the search field again and bring it into focus to set the cursor in the field so that the user can retype a correct value. The default FileMaker field validation that is found in the field's Options settings performs something very similar to what I described above. I'm trying to achieve a similar effect, but using a script instead to have more custom control and flexibility with the warning dialogs. Any help much appreciated. Custom validation - Search field.fmp12.zip
  8. Thanks! The example file works great. I noticed that a script trigger was also tied into it to have the calculation refresh. I wish there was a way of just doing this with a calculation alone. I find it rather strange how a calculation can determine if a field is empty instantly in real time, but determining the name of the active field requires more steps and scripts. Purpose of the calc I was playing with the idea of hiding a merge field dependent on certain conditions. The merge field is a calculation field. I have a large text field on a layout as well for taking notes. The text field is transparent to have it blend in with a background color. Instead of using a traditional static label on the side or above the field, I added the merge field (calculation field) to the center of the text field. I then set the calculation to display "Notes" when the field was empty and to display "" (blank) when the field was not empty (filled). The problem came when trying to type into the text box while it was originally empty from the start. While typing text into the field, the "Notes" text would remain on top, obscuring the foreground. I figured that by adding an additional condition to the calc this would fix. That's why I was trying to get the Active Field Name. To hide the "Notes" label if the Notes field was not empty (filled) OR if it was the active field (in focus). This mainly occurred because the field is transparent, if it wasn't I could set the merge field to the back of the transparent text box and have the text box become a solid color when it was active OR not empty. Is there any better way to tackle this, while retaining the transparency of the text field at all times? I could resort to a traditional label, I just felt a little adventurous and wanted to try out a new and more dynamic method.
  9. For some reason the Get(ActiveFieldName) function is not working in any of the tests I've done. I click into a field, but the calculation field with the function in place never changes to reflect the name of the field that has the focus. It just remains blank. The FileMaker website says: Get(ActiveFieldName) Purpose Returns the name of the field that has the focus. Thanks in advance for any help. I'm sure it's something I'm overlooking. Alex Get (ActiveFieldName).fmp12.zip
  10. Hi, maybe someone can help me with this question. I have three tables set up: Instructor table Instructor PK field Name field Programs Taught table (join table) <----- for many-to-many relationship Instructor FK field (Instructor PK) Program FK field (Program PK) <----- pop-up menu Hire Date field Program table Program PK field Name field Record State field ("Active" or "Inactive") Layout and portal: I have a portal showing the related records from the Programs Taught table on a parent layout based on the Instructor table. The portal has a pop-up menu with a conditional value list to select an existing program from the Program table and set the Hire Date that the Instructor began to teach that program. Value List setup: The value list is set up with two fields under the settings, the first field is the Program PK and the second field is the Program Name. I've set it up to show only the value from the second field (Program Name) in the pop-up menu, since the IDs from the PK field can be hard to reference. The value list is also based on a relationship to only show the programs that have a value of "Active" in the Record State field. Issue: The list is dynamic and works fine, but the problem I'm facing comes when a previously existing record found in the portal contains a program on the pop-up menu field that has now become "Inactive". If a program that is now "Inactive" previously existed in a portal record, the pop-up menu ceases to show the actual Program Name for those records as it used to and instead now shows the Program PK serial number value. How can I keep the conditional value list, to still show me the Program records that are only "Active", but also maintain the older portal records unaffected by future changes and displaying the actual Program Name value at all times as opposed to the Program PK serial number whenever a change is made and that given program is no longer part of the "Active" dynamic value list? Many thanks for any help. Alex Conditional Value List - Active records.fmp12.zip
  11. Yes, thank you for your reply. I also have a field that contains all the weekday names (in a return-delimited list, like checkboxes) that a class will occur on. The classes always follow the fixed pattern of weekdays that is set up in the return-delimited list mentioned above. Yes, that's why I also created a third related table containing Holidays/Cancellations as single records, with the dates they fall on. I'm thinking I would have to count all the relevant weekdays (the weekdays specified on the return-delimited list) from the Start date to the Current date, and skip a day if it's a Holiday/Cancellation that is previously set up in the Holiday/Cancellation table. I just can't figure out how to piece it all together, by using a calculation or script. I know this is a complex calculation, that's why I posted under the complex calculations and advanced scripts sub forum. I think I have all the data variables, just need help executing it. Maybe a smart Filemaker guru can help me take a crack at this. There's not much clear help on the web regarding this for a beginner.
  12. Hi everyone! Glad to have found the forum, the tips here are amazing. So I was wondering if maybe one of you could help me tackle this conundrum. I've searched several forums but I can't find a clear enough explanation. I'm working on a database for a friend, based on school attendance. I have a Student table and an Attendance table. One Student can have many records in the Attendance table. So the relationship is a one to many from Student ---< Attendance. The two tables have the following fields: Student table Name Start date End date Attendance table Date Present Each student enrolls in an educational program and begins classes on the date specified in the Start date field, the End date field is then automatically calculated to determine their graduation date. Each day a student comes to class they personally clock in at the front desk and a record in the Attendance table is created, set to present status in the Present field. If a student does not show up to class that day and is Absent, by default a record will not be created in the Attendance table because they did not clock in at the front desk. (I have chosen to use this method because the professors tend to not do a good job at manually inputing attendance and mistakes are made more than often.) How can I determine the number of Absences though a calculation field, using only the Present records that are normally created in the Attendance table when a student personally clocks in? Using the example of a week, a student is supposed to attend classes 5 weekdays per se, but at the end of that week only 3 Present records exist in the Attendance table from personally clocking in. 5 weekdays - 3 weekdays (or 3 Present records) = 2 weekdays (or 2 Absences) Now how can I perform this calculation accounting not just for a week, but for the period elapsed from the Start date field to the Current date? I want to be able to see how many "uncreated" or absent records a student has, from the Start date to the Current date, by comparing with the Present records that exist in the Attendance table. Thanks for any help in the right direction, my left brain is exhausted. Alex Using FMP 12, OS X Mountain Lion, Novice/Beginner
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.