1 2 Previous Next 18 Replies Latest reply on Oct 18, 2016 7:32 AM by David Moyer

    Hide Object When

    hbee

      Hello all

       

      I'm trying to set a 'hide object when' command but I'm rubbish at scripting and wondering if someone could help me.  I have the layout below:

       

      Untitled-2.jpg

       

      I need a script so that when the hazard drop down is blank (marked in red), all the other fields related to that hazard (circled in blue) and the hazard drop down are hidden when printing.  Is this something that can be done via the 'hide object when' option?  Any help would be greatly appreciated!

       

      Thanks

       

      Ben

        • 1. Re: Hide Object When
          David Moyer

          Hi,

          I think "Hide Object when" is all you need to hide your fields, on screen and when printing.

          Capture.PNG

          (just base this on your hazard#7 field)

          1 of 1 people found this helpful
          • 2. Re: Hide Object When
            hbee

            Hi David

            Ok that works great, thank you, but I need the field to only be hidden when printing, not on screen. How could I modify that script to accommodate that?

             

            Cheers

             

            Ben

            • 3. Re: Hide Object When
              fclark

              There is also hide when printing check box in the inspector. Or hide when get(windomode)>1

              • 4. Re: Hide Object When
                David Moyer

                good one fclark .

                So, hbee, your Hide Object when calculation would be

                IsEmpty(table::Hazard7) and

                Get(WindowMode) > 1

                I tested this in Preview mode, but not printing.

                • 5. Re: Hide Object When
                  hbee

                  Wow this works perfectly!  Thank you

                   

                  Only downside is that despite 'slide up based on: all objects above' being activated on all fields, I'm still left with a huge space when the fields are hidden:

                   

                  Untitled-2.jpg

                   

                  Any way to combat this?

                  • 6. Re: Hide Object When
                    philmodjunk

                    Be sure to select the "resize enclosing part" option.

                    • 7. Re: Hide Object When
                      philmodjunk

                      Also, all objects below the sliding fields also have to be set to slide up and resize.

                       

                      And this only affects the results shown when in Preview, printing or saving as PDF.

                      • 8. Re: Hide Object When
                        keywords

                        Hide object when … and Hide when printing are two independent functions. Hiding objects will hide an object on a layout in both Browse and Preview mode (and Find mode if the option is checked) when the specified condition is met—and this will operate record by record. Hide when printing hides the said object only in Preview mode, and no other condition needs to be specified—and this will apply to all records.

                        • 9. Re: Hide Object When
                          hbee

                          Hi philmodjunk

                           

                          Thanks for that.  Unfortunately, all objects on the page are set to slide up and resize but still no joy

                          • 10. Re: Hide Object When
                            user19752

                            Do you mean there are one or more records like "Hazard #4" etc. in next page?

                            If "Production Manager:" line is in footer, it is aligned to bottom, then the space remains if there is no more records.

                            • 11. Re: Hide Object When
                              hbee

                              No 'Production Manager' is just a line on the page, there is no footer.  So the page goes like this:

                               

                              Hazard Title

                              Hazard #1

                              Hazard #2

                              Hazard #3

                              Hazard #4

                              Hazard #5

                              Hazard #6

                              Hazard #7

                              Hazard #8

                              Production Manager

                               

                              When I enter info in the Hazard #1 and Hazard #2 lines, it currently looks like this:

                               

                              Hazard Title

                              Hazard #1

                              Hazard #2

                               

                               

                               

                              Production Manager

                               

                              And I need it to look like this:

                               

                              Hazard Title

                              Hazard #1

                              Hazard #2

                              Production Manager

                               

                              Make sense?

                              • 12. Re: Hide Object When
                                David Moyer

                                You can fix several problems at once by normalizing your Hazards into a Hazards table.  The new table would have these fields, for example ...

                                Capture.PNG

                                You need a Hazard ID field too.

                                You would only have enough Hazard records for populated hazards, so only those hazards would show on your report.  It would also make your layout much simpler.

                                • 13. Re: Hide Object When
                                  hbee

                                  Sorry David, don't understand this.  I already have a hazard values table:

                                   

                                  Untitled-3.jpg

                                   

                                  This allowed me to create a drop down list attached to the 'RA Hazard#8' field you see in your previous post.  Each of the hazards has an ID like you suggested which you can see in the image above.  So what are you suggesting I do to remedy the unwanted space issue?

                                  • 14. Re: Hide Object When
                                    David Moyer

                                    This would be yet another table that might be better titled "SiteSpecificHazards" which would contain a serial number (key) field for the job, location, site, machine, etc. and a serial number key that denotes the hazards you've already defined.  This table would have one record for each hazard at each site.  So site 1 might have 3 "site-specific hazards" 1, 4, 7 and site 2 might have five hazards 1, 2, 5, 7, 8.

                                    1 2 Previous Next