11 Replies Latest reply on Jul 1, 2014 2:36 PM by philmodjunk

    Conditional formatting

    tays01s

      Title

      Conditional formatting

      Post

           I have a portal where each record has a 'select' button to pull related records into a 2nd related portal. To make it obvious which record in the first portal is 'active' I've conditionally formatted some of the fields. I'd prefer to have the background conditionally formatted so that I can use different colours for different fields.

            

           Is this possible?? Would I have to create an empty field to use as the conditionally formatted background?

        • 1. Re: Conditional formatting
          philmodjunk

               There are different ways to implement that selection process. Exactly how that happens will determine what conditional format expression to use for your color change. So please describe what happens when that select button is clicked.

          • 2. Re: Conditional formatting
            tays01s

                 Selection: I haven't yet set it up, but the portal button would run:

            Set Field [ Patient::Calc_n; Calc::__CalcID ]

            Commit Records/Requests [ No dialog ]

                                This is to ensure that the child portal is only populated by records related to this specific record.

                                The conditional formatting of the fields use a condition formula of: Patient::Calc_n=Calc::__CalcID.

                                This is so that the parent record is indicated as active (by colour change).

                  

            • 3. Re: Conditional formatting
              philmodjunk

                   I see two table occurrence names: Patient, Calc.

                   Which is the parent and which is the child?

                   If I am guessing correctly that your layout is based on Patient and your layout is based on Calc, This script step would select a single record to appear in the portal of selected records. When you click a button in a different row, the first selection would disappear, replaced by the new selection. Is that what you want to happen here?

              • 4. Re: Conditional formatting
                tays01s

                     Exactly.

                • 5. Re: Conditional formatting
                  philmodjunk

                       If you only want to display one selected record at a time, you don't need a second portal as this relationship can be used to add the same fields directly to the layout.

                       You can use:

                  Patient::Calc_n = Calc::__CalcID

                       as your portal filter expression

                  • 6. Re: Conditional formatting
                    tays01s

                         I shouldn't have used the word 'exactly'. I meant that if you select a 'calc' record, that all the child (in this eg. 'prescription) records for that specific calc record are shown. There's a prescription portal filter: Prescription::_CalcID=Patient::Calc_n.

                         As mentioned, where I currently select, some of the selected Calc record fields change colour. However, I'd really like to colour-code some of these fields for other purposes. To still show that the record is selected I'd prefer to change that record's background colour.......if that is possible.

                    • 7. Re: Conditional formatting
                      philmodjunk

                           Please lay out all the relationships involved. This is the first that you have mentioned a table of Prescription records. If I don't known and understand the tables and relationships involved, it's a bit difficult to provide effective help. wink

                      • 8. Re: Conditional formatting
                        tays01s

                             Relationships: Patient < Calc < Prescription.

                             The Calc and Prescription portals are on the Patient layout.

                             My scripts allow choice of Patient to populate the Calc portal with related Calc records and if a 'select' button with the Calc portal is pressed to select particular Calc record, the Prescription portal is populated with Prescriptions relating to only that particular Calc.

                             There are further related child relationships beyond Prescription that I hope to deal with in a similar way to above.

                        • 9. Re: Conditional formatting
                          philmodjunk

                               Sorry, but I really need to see the match fields in order to better understand your relationships. I do not see how those relationships can work to select a single calc record as described unless you are also using a portal filter on the portal to the prescription records for the selected calc record. Is that what you are using? If so, please post the filter expression that you are using.

                               What you are describing  is sometimes referred to as "master detail" portals. You may find this thread helpful: Need layout solution for nested portals...

                          • 10. Re: Conditional formatting
                            tays01s

                                 Filters:

                                 Calc: Calc::_PatientID

                                 Prescription: Prescription::_CalcID=Patient::Calc_n

                                 I will look at your suggested link.

                            • 11. Re: Conditional formatting
                              philmodjunk

                                   Sorry, but:

                                   Calc: Calc::_PatientID

                                   makes no sense as a portal filter.

                                   but I just spotted an error in a previous post. When I posted:

                                   

                                        You can use:

                                   

                              Patient::Calc_n = Calc::__CalcID

                                   

                                        as your portal filter expression

                                   I should have posted:

                                   

                                        You can use:

                                   

                              Patient::Calc_n = Calc::__CalcID

                                   

                                        as your conditional format expression