2 Replies Latest reply on May 23, 2016 1:18 AM by keywords

    Popover | Portal record script required

    ajayz

      Hi

      I have a layout called COMPANY DETAIL, and i've added a popover window which shows a portal, displaying ALL companies within the database.

       

      Relationship:

      Screen Shot 2016-05-23 at 5.28.16 PM.png

       

      Company_ Details is the main table - Company_Detail_search is just a clone of the table.

       

      Screen Shot 2016-05-23 at 5.10.40 PM.png

      I've made the "Company" field within the port a button. I need help with the script that will automatically update the COMPANY DETAIL layout with the "company" selected from my popover window

       

      I would generally use the script "go to related record" however, the relationship isn't related, as  the portal needs to show all companies.

       

      My company field on the COMPANY DETAIL layout is called :  Company_ Details::Company

       

      The company field on the portal is called: Company_Detail_search::Company

        • 1. Re: Popover | Portal record script required
          erolst

          ajayz wrote:

          I would generally use the script "go to related record" however, the relationship isn't related, as the portal needs to show all companies.

          If the “relationship is not related”, how can you display a portal?

           

          If “update” means “show the related record that the portal row represents in the current layout”, then do just that:

           

          Go to Related Record [ from: Customer_Details_Search ; layout: <current layout> ]

          1 of 1 people found this helpful
          • 2. Re: Popover | Portal record script required
            keywords

            A couple of things:

             

            1.   By "clone" I hope you don't mean you have duplicated the Company table. If so, don't. A separate TO (Table Occurrence) of the same table is all you need.

             

            What you are actually trying to do is not entirely clear, at least to me. I assume you are on some activity layout to which you want to link a specific company. In that case

             

            2.     I assume the portal is working for you. To select a specific company from the portal you need a button contained entirely within a portal row to run the script, so that it references the row it is part of. The script itself needs to:

            –  use Set Variable to capture the kp_Company from that portal row

            –  close the popover

            –  use Set Field to insert this value into the relevant foreign key field (I assume you already have an active record before activating the popover from your Select button).