2 Replies Latest reply on Nov 26, 2013 10:29 AM by ChrisJohnston

    Set Container? Scripting use with Containers.



      Set Container? Scripting use with Containers.


           I have a Layout based on Table::ITEM with a portal based on Table::PHOTOS. In one record for ITEM I have 7 related photos from PHOTOS. In another area of Layout based on ITEM I want display on 3 of the PHOTOS. So I have 3 containers that need a Script or other way to populate them when some condition is met. I have a field named position in PHOTOS. Is there a way to make it do this if the field position is equal to 1, 2, or 3?

           I would imagine a Script would be the way here. I guess the concept I need to learn is how Scripting can control the population of a Container. Can Scripting set a container as easy as it can set a field? Am I on the right track?

        • 1. Re: Set Container? Scripting use with Containers.

               This is a common type of response from me, but nevertheless...

               You have multiple options for doing that.

               1) Set field can copy container field data from one container field just like it can data from other field types.

               2) Calculation fields can select "container" as the result type, so you can define a calculation with If or Case that selects for different records/fields in order to selectively return the contents of different container field images.

               3) Since your data is stored in related records, your three container fields could simply be fields in one row portals or fields from the related table placed directly on the layout where relationships and/or a portal filter select for a specific related record in order to show the container field from that related record.

          • 2. Re: Set Container? Scripting use with Containers.

                 Yes, number 3 is something I did not even consider. Makes total sense. Its is also good to be clear on the other 2 as an option for when needed. Thanks!