Jump to content

Alex117

Members
  • Content count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Alex117

  • Rank
    member

Profile Information

  • Gender
    Male
  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. 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?
  4. 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).
  5. 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 [ ]
  6. 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
  7. 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.
  8. 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
  9. 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
  10. 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.
  11. 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
×

Important Information

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