1 2 Previous Next 18 Replies Latest reply on May 29, 2009 6:01 PM by CountryBoy1

    Detect Fill Color?

    CountryBoy1

      Title

      Detect Fill Color?

      Post

      Is there any way to detect what the fill color

      of a field is ?  The fill color is set by

      conditional formatting in Layout ?

      (Using Filemaker Pro 9 advanced:)

         Thanks for your help.  CountryBoy1

       

       

       

       

        • 1. Re: Detect Fill Color?
          philmodjunk
            

          Instead of checking for fill color, why not check for the same conditions that the conditional formatting uses to set the fill color?

           

          Example: If Self>5 is the condition that changes the color, check the field for values greater than 5.

          • 2. Re: Detect Fill Color?
            CountryBoy1
              

            Dear PhilModJunk:

                  The problem is a little deeper than presented.  I am trying to detect when a

             related field (in another table) is changed.  Have discovered that the fill color
             (using a calculation) ALWAYS keeps up with a change in a related field. 

                  The field I am interested in is a field that uses a calculation.  It cannot

              be a CALCULATION field.  Therefore, the calculation ONLY gets performed

              when a new record is created.  When the related field is edited, the field

              of interest does NOT recalculate, although the fill color DOES change.

                  Sincerely, CountryBoy1

             

            • 3. Re: Detect Fill Color?
              comment_1
                

              CountryBoy1 wrote:

              the calculation ONLY gets performed

                when a new record is created.  When the related field is edited, the field

                of interest does NOT recalculate


              If it field's type is Calculation, and it references a related field, it will recalculate when the related field is modified (subject to screen refresh).


              • 4. Re: Detect Fill Color?
                philmodjunk
                  

                "When the related field is edited, the field of interest does NOT recalculate, although the fill color DOES change."

                I suggest that if the color is changing, the values the conditional format expression is using to determine color, must also change and this should be something you can detect. Perhaps it would help to post your conditional format expressions to your thread so we can better understand the issue.

                • 5. Re: Detect Fill Color?
                  CountryBoy1
                    

                  Dear PhilModJunk:

                             Yes, if the field of interest is a CALCULATION field, it will ALWAYS

                      recalculate.  However, the field of interest CANNOT be edited.

                             Suppose that if the related field is set to "No", then I want the

                      field of interest to be set to "No".  However if the related field is set

                      to "Yes" or something else, then I want the field of interest to be

                      able to use a drop-down menu.

                              Sincerely, CountryBoy1

                   

                  • 6. Re: Detect Fill Color?
                    philmodjunk
                      

                    Would you explain how all that affects your conditional formatting?

                     

                    I'm trying to understand the process. From where I sit, I can't see how you're getting a color change without also getting a value change. If you are getting a value change, then you should be able to check for that value with your scripts, calculations, find requests, etc.

                     

                    I'm not trying to disagree with you. I just don't see how all the information you've posted fits together.

                    • 7. Re: Detect Fill Color?
                      comment_1
                        

                      Well, a stored field will not recalculate when a related record is edited. It won't recalculate when another field's conditional formatting changes either - so that's a dead end in any case.

                       

                      Perhaps if you explained the real issue behind all this, some way may be found.

                      • 8. Re: Detect Fill Color?
                        CountryBoy1
                          

                        Dear PhilModJunk:

                               Will try to explain it again:

                                         I.  If the related value in TableA is changed (via a drop-down menu) from "Yes" to "No",

                                             this should cause the field in TableB to calculate to "No".  The fill color will turn to red.

                                        II.  If the related value in TableA is changed to "Yes", this should cause the field in TableB

                                             to be set to "     " at which point the field in TableB can be set with a drop-down menu.

                                             The fill color will turn to green.

                         

                               What happens is this:

                                         I.  When the value in TableA is set to "No", the fill color of the field in TableB sets to red.

                                             However, the calculation for the field in TableB does NOT update.

                                        II.  Likewise, when the value in TableA is set to "Yes" , the fill color of the field in TableB

                                             sets to green.  However, the calculation for the field in TableB does NOT update.

                                   

                               If I go to the Index value in TableB and reset it (but don't change it), a recalculation for the field in TableB will occur.

                               If I make the field in TableB a CALCULATION field, then, yes, it ALWAYS updates.  However it CANNOT

                               be edited.

                         

                               In an ideal world, the user will have the correct values in TableA before the new record for TableB is

                               created and I wouldn't have to worry.  However, we know that that is not the real world.

                         

                        • 9. Re: Detect Fill Color?
                          philmodjunk
                             Please post your actual conditional format expression.
                          • 10. Re: Detect Fill Color?
                            CountryBoy1
                              

                            Dear PhilModJunk:

                               Here is the calculation code in TableB for FieldB that needs to be updated whenever

                               the Category (FieldA in TableA) changes.   Category values in TableA can

                               be from 1 to 9.  If the Category value is other than 7 or 9, the user can set FieldB with a

                               drop-down menu.  (There is also a Category field in TableB that is related to the Category

                               field in TableA and it keeps up with the changes in TableA.  Unfortunately, the calculation for FieldB

                               in TableB won't work if it tries to use the Category value in TableB.  It must therefore

                               use the Category value in TableA.)   By the way, the Category field in TableA is a CALCULATION field that

                               looks at other fields in TableA.  The FieldB in TableB is a text field that has a calculation (as shown below).

                             

                            Case ( ( TableA::Category= 7  ) ;  //  Not Valid

                                            "No" ;
                                      ( TableA::Category = 9) ;  // Of Interest Only

                                           "No" ;
                                            Self
                            )

                             

                              Right now I have a system set up that uses a global to tell me the most recent record changed

                              in TableA and I have an "update" function in TableB that reads the global and updates the record

                              that needs to be updated.  Of course the user has to push the button in TableB for the update to occur.

                             

                              Sincerely, CountryBoy1

                             

                             

                            • 11. Re: Detect Fill Color?
                              CountryBoy1
                                

                              Dear PhilModJunk:

                                 Category in TableA is a CALCULATION field that looks at other fields in TableA.

                                 The Case statement is the calculation for FieldB in TableB that needs to be updated

                                 whenever the Category value in TableA changes.  The user can set FieldB with a drop

                                 -down menu also. The background for FieldB turns red if it's value is "No".

                               

                              Case ( ( TableA::Category= 7  ) ;  //  Not Valid

                                              "No" ;
                                        ( TableA::Category = 9) ;  // Of Interest Only

                                             "No" ;
                                              Self
                              )

                               

                                Right now I have a system set up that uses a global to tell me the most recent record changed

                                in TableA and I have an "update" function in TableB that reads the global and updates the record

                                that needs to be updated.  Of course the user has to push the button in TableB for the update to occur.

                               

                                Sincerely, CountryBoy1

                               

                               

                              • 12. Re: Detect Fill Color?
                                philmodjunk
                                  

                                Thanks for your posts, but these don't appear to be what I requested in order to better understand the issue.

                                 

                                I understand that indexing/storage issues can force you to use a technique such as you describe under some circumstances. You indicated that you had a conditional format that changed color even though the field values did not. What I was asking for, was the expression you use to set the conditional format color.  

                                 

                                • 13. Re: Detect Fill Color?
                                  CountryBoy1
                                    

                                  Dear PhilModJunk:

                                     The conditional formatting for the background color (fill color) is like this:

                                     It is a "Formula" and not a "Value".

                                   

                                  TableA::Category= 7  //  (This sets the background color (fill color) to "red"

                                  TableA::Category= 9  //  (This also sets the background color (fill color) to "red".

                                   

                                     This is all there is to it,  and it does keep up with changes in TableA.

                                   

                                     Sincerely, CountryBoy1

                                  • 14. Re: Detect Fill Color?
                                    philmodjunk
                                      

                                    Your original question:

                                    "Is there any way to detect what the fill color of a field is ?  The fill color is set by conditional formatting in Layout ?"

                                     

                                    Answer:

                                     

                                    The expression:

                                     

                                    TableA::Category= 7 OR TableA::Category= 9

                                     

                                    Will detect that the fill color of the field is red.

                                     

                                    1 2 Previous Next