1 2 Previous Next 15 Replies Latest reply on Oct 24, 2012 5:49 AM by brian.curran

    Conditional Formatting or Pop Up Alerts

    brian.curran

      Title

      Conditional Formatting or Pop Up Alerts

      Post

           Hi,
           I have a layout that is based on the People table which contains contact details and there is also a portal based on a Join to the Sites table, which shows the Sites that people belong to.

           In this join table and portal there is a checkbox set for the 'Role' field. What I would like to do is either conditionally format a field on the People record whenever a checkbox is ticked or have an alert pop up.

           For example:

             
      •           Primary contact
      •      
      •           No. 2 contact
      •      
      •           Billing
      •      
      •           Maintenance
      •      
      •           Key Holder

           If Billing is ticked, I want to check the 'Phone' and 'Email' fields to see if there are any values.
           If Key Holder is ticked, I want to check whether there is a value in the 'Mobile No.' field.

           If the fields are empty, then either highlight the fields or maybe create a pop up alert, any suggestions would be great.

           Thanks
           Brian.

        • 1. Re: Conditional Formatting or Pop Up Alerts
          schamblee

               I would use the tooltip so when you hover over the field with the mouse it would show the desired information.  You may have to incorperate a calculation field to determine which information to display in your tooltip.

          • 2. Re: Conditional Formatting or Pop Up Alerts
            philmodjunk

                 Conditional formatting can change the fill color based on the value of other fields.

                 You might also set some validation rules so that a validation error message pops up if required data is missing from a field. You can set up a validation calculation that does exactly what you describe in your post.

            • 3. Re: Conditional Formatting or Pop Up Alerts
              brian.curran

                   Just to clarify, not all fields are compulsory but they would become compulsory if a certain check box was ticked.

                   For example:
                   Joe Bloggs doesn't need an email address recorded as he's a "Key Holder" and that role only requires a phone or mobile number. However, he requests to be included in the Billing report so when that box is ticked, something visual needs to happen to alert the user that the email address is now a compulsory item.

                   Would the validation calculation be able to handle the above scenario?

                   Thanks
                   Brian. 

              • 4. Re: Conditional Formatting or Pop Up Alerts
                philmodjunk
                     

                          Just to clarify, not all fields are compulsory but they would become compulsory if a certain check box was ticked.

                     Which is why you would set up a calculation on the validation tab to verify whether the field can or cannot be left empty.

                     IsEmpty ( BillingReport ) Or Not IsEmpty ( Self )

                     might be a validation rule for a field that cannot be left empty if BillingReport is not empty.

                • 5. Re: Conditional Formatting or Pop Up Alerts
                  brian.curran

                       Ok great, I'm pleased to hear that it's possible...

                       I've just tried the following validation rule but FM complained about too many parameters in the function:
                       IsEmpty ( _JoinPeopleSite::Role ; "Billing" ) or not IsEmpty ( Self )

                       Brian.

                  • 6. Re: Conditional Formatting or Pop Up Alerts
                    philmodjunk

                         ; "Billing"

                         cannot be inside the IsEmpty Function. Why did you add that text?

                         You can use

                         IsEmpty ( _JoinPeopleSite::Role )

                         to test to see if the field is empty. If this is a single value check box field, that test should be sufficient.

                         If it is a pop up menu or radio button field where a value other than "billing" might be selected, you can use

                         _JoinPeopleSite::Role ≠ "Billing"

                         If this is a field, such as a check box group, where multiple values might be selected in the same field, you can use:

                         IsEmpty ( FilterValues ( _JoinPeopleSite::Role ; "Billing ) )

                    • 7. Re: Conditional Formatting or Pop Up Alerts
                      brian.curran

                           Hi Phil,
                           I added  ; "Billing" as that was the bit I was trying to evaluate but I didn't realise it all needed amending to FilterValues, still learning here ;)

                           The field is as your last option suggests, i.e. a check box group. I've tried adding the expression as shown above and also with the " or not IsEmpty ( Self )" tagged on the end of it but it doesn't seem to make any difference on the layout.

                      Is there anything else I need to do to test this out?

                      Thanks
                           Brian.

                            

                            

                      • 8. Re: Conditional Formatting or Pop Up Alerts
                        philmodjunk

                             Did you try this on a new record, entering data and then committing the record? This won't flag existing records that fail the newly added validation rule.

                             In fact, needing to commit the record before the validation kicks in can be a significant drawback to this approach. I frequently put a validation rule in place as "insurance" to keep the user from inputting invalid data, but then use script triggers and conditional formats to make the error trapping more user friendly.

                             In many cases, my final interface design makes tripping the validation rule very unlikey, even impossible. But I keep it in place just in case...

                        • 9. Re: Conditional Formatting or Pop Up Alerts
                          brian.curran

                               Just entered a new record in People but no email address and clicked save to add the record to the People table. I then selected a Site in the JoinPeoplSite portal and ticked the 'Billing' check box in the check box group before commiting the record by clicking outside of the portal.

                               Nothing happened so I changed the People ID to be generated 'On creation' and tried again but no change. This might be a silly question but does the validation take place in the 'Email' field or in the 'Role' Checkbox field? I've tried both but...

                               I think I'm in need a freelance developer! :(

                          • 10. Re: Conditional Formatting or Pop Up Alerts
                            philmodjunk

                                 SInce this validation references the values of two fields, it should kick in when the records are committed.

                                 How about copying the exact validation calculation from FileMaker and posting it here?

                            • 11. Re: Conditional Formatting or Pop Up Alerts
                              brian.curran

                                   Sorry for the delay, just downloaded the update for FM and it took ages for some reason...

                                   I've tried both of the following without success:

                                   IsEmpty ( FilterValues ( _JoinPeopleSite 2::Role ; "Billing" ) )
                                   IsEmpty ( FilterValues ( _JoinPeopleSite 2::Role ; "Billing" ) ) or not IsEmpty ( Self )

                              • 12. Re: Conditional Formatting or Pop Up Alerts
                                philmodjunk

                                     The issue may be that _JoinPeopleSite 2::Role comes from a related table. At the time that this validation rule evalulates, there may not be a valid link to the _JoinPeopleSite 2 table occurrence. It's also possible that there IS a valid link but to a different related record than you expect. If a calculation refers to a field from a related table and there is more than one related reocrd, the calculation references the "first" such related record.

                                • 13. Re: Conditional Formatting or Pop Up Alerts
                                  brian.curran

                                       Ah well, it looks like it may be easier to just educate our users to validate themselves. Thanks anyway Phil, it's appreciated...

                                  • 14. Re: Conditional Formatting or Pop Up Alerts
                                    philmodjunk

                                         There's still the script trigger option that can perform a script and check the values of the fields.

                                    1 2 Previous Next