1 2 3 Previous Next 33 Replies Latest reply on Oct 11, 2016 7:55 AM by dtcgnet

    Tab control conditional formatting

    globe11123

      For some reason the formatting on my tab control doesn't always work. This may be down to using a Cartesian join to find the data.

       

      Basically I want the tab's text to turn red when work arrives which sometimes that works.

       

      Here is what its looking at :-

      Get (AccountName) = Works_Scheduler_Dashboard::Allocated_To and Works_Scheduler_Dashboard::Status = "In Progress"

       

      I'm trying to match their account name against who the work is allocated to and also the status must be In Progress. This did work for the first few records but now it seems the formatting doesn't work at all.

       

      Is there a better way of doing what I'm trying to achieve. i.e notification / formatting to show that there are records present.

        • 1. Re: Tab control conditional formatting
          Johan Hedman

          You can do this directly in label for the Tab.

           

          I tune down the color of my tab when I dont have any information there doing this:

           

          // LABEL

          Case(

          Cu_Invoice::YidIn = ""; TextColor ( "Invoice" ; RGB ( 170 ; 170 ; 170 ) );

          "Invoice"

          )

           

          This will give you a light gray color when there is not information.

          1 of 1 people found this helpful
          • 2. Re: Tab control conditional formatting
            globe11123

            By label do you mean here on Tab name or within the tabs condition formatting?

            LOL.png

            • 3. Re: Tab control conditional formatting
              Johan Hedman

              Exactly, that is the Tab that I wrote about.

               

              Cu_Invoice::YidIn is just a related field for me, but it could be your calculation instead

              • 4. Re: Tab control conditional formatting
                globe11123

                Text color still isn't changing :S

                 

                Will this be down to my Cartesian join?

                • 5. Re: Tab control conditional formatting
                  Johan Hedman

                  It is a little bit tricky, after doing your change you have to push Rename to save your changes

                  Skärmavbild 2016-10-10 kl. 13.49.22.png

                  • 6. Re: Tab control conditional formatting
                    globe11123

                    Sorry its monday hahah.

                     

                    Text is not changing

                     

                    // LABEL

                    Case(

                    Get (AccountName) = Works_Scheduler_Dashboard::Allocated_To and Works_Scheduler_Dashboard::Status = "In Progress"; TextColor ( "Work Schedule" ; RGB ( 255 ; 0 ; 0 ) );

                    "Work Schedule"

                    )

                     

                    Will this be down to my Cartesian join?

                    • 7. Re: Tab control conditional formatting
                      Johan Hedman

                      255, 0 , 0 is RED color

                      Otherwise you will get your default tab color

                       

                      if you change the RGB to

                       

                      // LABEL

                      Case(

                      Get (AccountName) = Works_Scheduler_Dashboard::Allocated_To and Works_Scheduler_Dashboard::Status = "In Progress"; "Work Schedule";

                      TextColor ( "Work Schedule" ; RGB ( 255 ; 0 ; 0 ) )

                      )

                       

                      it will be red if it in or more of your questions are not true

                       

                      Your related fields in table Works_Scheduler_Dashboard is up to you to make it work. I am just guessing they are related data.

                      • 8. Re: Tab control conditional formatting
                        globe11123

                        Yes I wanted the text to be red if there was data in the portal that this tab is for.

                         

                        The tab is held on the dashboard which has a cartesian join to Works_Scheduler_Dashboard to display all records. The portals are then filtered to the username to filter there work.

                        • 9. Re: Tab control conditional formatting
                          Johan Hedman

                          As longs as your relationships works you should get the text Work schedule red if both your questions is true.

                          • 10. Re: Tab control conditional formatting
                            dtcgnet

                            Because you have a Cartesian join to Works_Scheduler_Dashboard, then all records in that table are related to whatever record you are viewing on the layout. Because of that...your results will all be based on the FIRST related record from Works_Scheduler_Dashboard. Always. If you sort the relationship, that will change whatever the FIRST related record is, but, you'll still be tied only to that first record.

                             

                            If the FIRST record's status is "In Progress", then the calculation will always be true for Status = "In Progress". If not, then it will NEVER be true.

                             

                            I see that you are filtering the portal. Can you provide the calculation you're using for that? Also...what is the table you're using for the layout on which the tab occurs?

                            • 11. Re: Tab control conditional formatting
                              globe11123

                              Ah I thought so.

                               

                              The portal is filtered by

                               

                              (Works_Scheduler_Dashboard::Allocated_To = Get (AccountName)) and (Works_Scheduler_Dashboard::Status = "In Progress" and Works_Scheduler_Dashboard::Work_Complete = "")

                               

                              The table that the layout is on is Called Dashboard, this just links to other tables through Cartesian joins to view data.

                              • 12. Re: Tab control conditional formatting
                                dtcgnet

                                So Dashboard has exactly 1 record? (Just checking).

                                 

                                As the number of records increases, you're going to encounter some performance issues. Why? Because every record is always visible to that portal, and they all have to be evaluated every time anything happens (because you're also sorting the portal). The records are delivered to the client, and then those that should be filtered out are filtered out.

                                 

                                If you always want a person to see ONLY records that are for that person (the AccountName) portion, then put that in your relationship instead of the portal filter. Add a global field to Dashboard, and fill it with Get ( AccountName ). Your relationship could then have the cartesian join AND Dashboard::AccountName = Works_Scheduler_Dashboard::Allocated_To.

                                 

                                What are the other statuses? If only the In Progress records will ever be viewed in the portal, then again, find a way to add that to your relationship instead of a portal filter. If you'd like to be able to SELECT amongst various statuses, then you could set a $$ variable that you'd set with a button. If In Progress is clicked, you'd set $$SelectedStatus = "In Progress" for instance. The portal filter would change to W_S_D::Status = $$SelectedStatus.

                                 

                                You seem to want to know if any of the records in the portal are for a person and are in the status of "In Progress". Is that what you're after? If any one of the records is In Progress, you turn the tab red?

                                • 13. Re: Tab control conditional formatting
                                  globe11123

                                  Yes there is only one record.

                                   

                                  There are only two statues "In Progress" and "Complete.

                                   

                                  And yes that is correct. To let them know that there is work available.

                                  • 14. Re: Tab control conditional formatting
                                    globe11123

                                    A-ha its working.

                                     

                                    I didn't realize that data could be filtered this way.

                                    1 2 3 Previous Next