8 Replies Latest reply on Mar 15, 2016 6:14 PM by User24245

    Showing records in a portal

    andresen

      Working in customers layout. In there I want to add a contact person that are shown in a portal. I start the input inside a floating button. When I start typing I see the name in portal too. When I finished the name in portal I wrote is gone. If I then switch over to Contact layout the name is there in a new post.

      I made 2 scripts for floating button. one for adding and one for saving.

       

      How can I get the persons name to stick in the portal for that customers?

        • 1. Re: Showing records in a portal
          mikebeargie

          Do you have a sample file you can post?

           

          It sounds like either your portal is being filtered, or your relationship is invalid.

           

          Things to check:

          -Turn off portal filtering

          -Make sure all objects on the portal row are contained inside of the row boundary. Do not overlap portal fields outside of the row.

          -Open script debugger while you are adding a record and see if anything looks suspicious.

          -Make sure the relationship between Customers and Contacts is valid. (Should be Customers::ID = Contacts::CustomerID )

           

          Does a refresh window script step show the newly created contact? Or is it always missing completely?

          • 2. Re: Showing records in a portal
            andresen

            Customer layout.tiff

            Order layout-Customer tab.tiff

            The first pic are the layout that this problem is.

            Don't know how to insert a sample file. It's only a website and I only have a file.

            • 3. Re: Showing records in a portal
              andresen

              Now I find how to inset a file.

              • 4. Re: Showing records in a portal
                User24245

                Hi,

                 

                I have checked your file, And please refer my comments below,

                 

                1. Kunder (Is this Swedish ?) table has __KontackIDpk filed as primary key.

                2. Kontakt table has associated to Kunder by using _KontackIDfk as foreign key.

                3. Kontakt records are shown on the portal in Kunder layout by using relationship __KontackIDpk = _KontackIDfk.

                I think It's OK so far.

                 

                However, Your script running after onEnterExit trigger "Flytande monster | Ny contact fording" has some problem i think.

                So, Please try comment out second line "Set Field [ Kunder::__KontaktIDpk ; KontaktGlobal::__KontaktIDfk ]".

                Because your primary key will be erased if KontaktGlobal::__KontaktIDfk has blanked or not set.

                Then, you can keep __KontackIDpk = _KontackIDfk relationship anyway.

                 

                After that, Please consider how insert multiple Kontact to Kunder.

                I hope I can be of any help to you.


                Thanks.

                • 5. Re: Showing records in a portal
                  andresen

                  It's swedish!

                  I comment out row 2 and now I can see the typing i do in the window. Fine...

                   

                  But now if I want to make a new contact on same customer the old contact come up in the window. I want it to be empty, so I can put in the new one.

                  Any idé how to fix this?

                  • 6. Re: Showing records in a portal
                    User24245

                    Hi,

                    >It's swedish!

                    Sounds good !  I reply from Tokyo Japan for my study English.

                    But now if I want to make a new contact on same customer the old contact come up in the window. I want it to be empty, so I can put in the new one.

                    Any idé how to fix this?

                    There are several solution to fix it. Typical solution is below.

                     

                    1. Add corresponding fields with global storage option for all necessary  information.

                    * if you need "Kontakt adress" filed, you should add "g.Kontakt adress" field with global storage option.

                     

                    2. On the layout mode, Change all input form field located on the popover window to global storage option fields.

                     

                    2. Then, Initialize all global storage option fields to blank  by using "Flytande fönster | Ny kontakt" scirpt.

                    * Please don't forget copy "__KontackIDpk" in order to store "g._KontaktIDfk".

                     

                    3. Filled in information as you like.

                     

                    4. Then, save all information as new record to Kontakt table by using "Flytande fönster | Ny kontakt färdig" script.

                    I mean, change layout Kontakt -> new record -> set field from global fields to actual fields -> commit record -> change layout kunder.

                     

                    Now, you can add new Kontakt to same Kunder i think.

                     

                    Please refer my attached file for your reference.

                     

                    Thanks.

                    • 7. Re: Showing records in a portal
                      andresen

                      I see it works. I have tried to make a script steep that erase the post if you don't fill in something i the window, but I can't make it work.

                      So how do you erase the post if you regret open the "add contact" button?

                      • 8. Re: Showing records in a portal
                        User24245

                        Hi,

                         

                        If i were you, I will add "Add Contact" button on the popover window in order to assign "Flytande fönster | Ny contact fording" script. Then, uncheck the onExitScript trigger.


                        I mean, the new Kontact record is never add unless you click "Add Contact" button.

                        And also ,If you want to check valid input information, You have to add empty check sequence before add Kontact record.


                        [ Example ]

                        If IsEmpty( g.Kontakt Something )

                             Show Custom Dialog with "Kontact Something is required" message and Exit Script

                        End If


                        Thanks.

                        Screen Shot 2016-03-16 at 10.08.19.png