4 Replies Latest reply on Feb 25, 2014 10:11 AM by quietstorm

    Updating a target field via portal

    quietstorm

      Title

      Updating a target field via portal

      Post

           I'm a newbie, and this is probably a problem with an easy solution; if its been asked before, I apologize.

           I have 2 tables, a layout based on Table A, containing a Portal to Table B, and a separate container field (for photos) from Table B.

           I want to be able to select a record in the Portal and have the container field in Layout A update its target to the record currently selected in the Portal.

           How do I accomplish this? I've tried different script steps and nothing seems to work. 

           Thanks!

        • 1. Re: Updating a target field via portal
          philmodjunk

               Before we talk scripts, we need the right relationships.

               I will guess that you have these relationships:

               Table A ----< Table B

               Table A::__pkTableAID = _fkTableAID

               There are two different approaches that can get what you request:

               Add another table occurrence of Table B to your relationships

               Table A -----< Table B | Selected

               Table A::_fkSelectedRecord = Table B|Selected::__pkTableBID

               A button in your portal could do this:

               Set field [Table A_fkSelectedRecord ; Table B::__pkTableBID ]

               A container field from Table B|Selected would then show the image from that portal row record.

               Or you can define a new container field--either with global storage or just defined as a container field in Table A.

               Then your script step would be:

               Set Field [Table A::ContainerField ; Table B::Container Field ]

          • 2. Re: Updating a target field via portal
            quietstorm

                 Those are the relationships I have set, yes. I think I like the second option, because table occurrences still confuse me. But how does Table A know which record from ContainerField in Table B to display? Just by selecting that record in the portal?

            • 3. Re: Updating a target field via portal
              philmodjunk

                   Yes, the mouse click that clicks the button in the portal row also selects that portal record and makes it the record that that the set field step references for data.

              • 4. Re: Updating a target field via portal
                quietstorm

                     Thank you, that worked!