6 Replies Latest reply on Aug 21, 2016 8:29 PM by moderndesigns9

    Portal and Fields

    moderndesigns9

      I Have a portal that when I input data and click out the portal the data in the fields I inputted disappear. I have a + button that runs a script for adding a new portal row for more data entry. If I click that button and input data and click out the portal is  doesn't disappear... How can I make it to where if I try inputting data in the next line of fields without clicking that + button the fields are disabled/uneditable so if forces me to click that button to add a new field.

        • 1. Re: Portal and Fields
          jbrown

          Portals are objects that show related data in another table. For example, A company has many employees. The employees can be in a portal. You can see all the employees in a portal for each company.

           

          By nature, portals show related data, but they can be set to allow for addition of records. If this setting is checked, then a blank row will be at the bottom of the list of existing records in the portal.

           

          Your script, it seems, adds another related record to the table inside the portal allowing you to add new data. What you'd like, I believe, is to skip the step of hitting the + button.

           

          To do that, go into the relationships graph. Find the relationship that allows the portal data to be shown. Check the box that says "Allow creation of records in this table via the relationship" on the child table size. In my example above, I'd check this box on the "Employees" side.

          Portal.png

           

          Doing this will allow you to enter a new record at the bottom of the portal. THere will be a blank line with the fields enterable to add the new data.

          Here's a video that might be useful.

          This video explains it well and gives you a better method for creating records via a portal.

           

          If you have FM 13 or above, here's another video explaining an even better way to create records via a popover into a portal. You'd have to tweak it a bit to make it work. Let us know if you would like to explore that.

          • 2. Re: Portal and Fields
            moderndesigns9

            I'd like to click the + button because it runs a script that gets data for me so that when I add new data to the next portal row it updates my numbers later....

             

             

            but if I don't click the button I can still add data but once I click outside the portal that newly data that I just inputted without clicking the button get removed.

             

            I would like the fields not to be modifiable unless I click that button.... I need this button to be pressed so it runs its script for updating when I add another portal row.

            • 3. Re: Portal and Fields
              jbrown

              but if I don't click the button I can still add data but once I click outside the portal that newly data that I just inputted without clicking the button get removed.

              hmm. I'm stumped on this one. I can only think of a few things that might cause this:

              1. The record you enter sorts to the bottom of the list, in some cases maybe taking it out of your view.

              2. Somehow you're changing the field on the child side that is used in the relationship.

              I'll think more on this one. . .

               

              I would like the fields not to be modifiable unless I click that button.... I need this button to be pressed so it runs its script for updating when I add another portal row.

              I guess the simplest way is to remove the check box  that I pointed to in the pic above and use the script in the + button to actually create a record in the portal's table. You'd have to do a few things:

              1. Get the primary key of this parent record you're on: set it in a variable.

              2. Go to a layout that is based on the portal's table.

              3. New record.

              4. Set the foreign key field (the one used in the relationship) to the value you put in the variable.

              5. Go back to the original layout.

               

              This will put a new row in the bottom of the portal for your use.

               

              Check out the videos I pointed to. They may show some things you're looking for.

              • 4. Re: Portal and Fields
                moderndesigns9

                Ok sweet yes I forgot got about my filter I set within the portal, I might be able to work with all this and try it out...

                 

                Thank you.

                • 5. Re: Portal and Fields
                  jbrown

                  That might do it. Your filter doesn't match what you've entered.

                  I should have thought of that.

                   

                  Good luck.

                  • 6. Re: Portal and Fields
                    moderndesigns9

                    Thank you so much I think it just worked out, I uncheck the box and now my script on my button is doing what it needs to do. I didn't know and or forgot that if you create a new record in the layout the portal is connected to it will allow you to edit the fields in the row it creates.

                     

                    Works Perfect!!!!