10 Replies Latest reply on Oct 6, 2016 8:19 AM by Johan Hedman

    Caller ID All Client Refresh

    GoogleMac

      I have a caller ID system in place that can only update the incoming calls portal (on the side of the layout) when the refresh button is pressed. My caller ID is being populated by PHP. I set it up to commit the records and then onRecordCommit in the Caller ID file, the refresh script is called in the main file. In theory, this should work, but I can't get the portal to add a new row with the caller ID.

       

      I have tried using the PHP newScriptCommand to bypass the onRecordCommit, but this doesn't work properly. I believe it only runs that script on the server machine, but I need all clients to be refreshed.

       

      Simply, I just need the portals on my client computers to show the newly added record once it is created in the Caller ID database on the server. I don't want the office workers to have to push a refresh button- this should be automated.

       

       

      What are your thoughts? I certainly don't expect you to do the work for me, but I do value your insight.

        • 1. Re: Caller ID All Client Refresh
          Johan Hedman

          First off, why do you even go with PHP for this

           

               In a Portal Settings you can choose to add records automatically

          Skärmavbild 2016-10-06 kl. 08.21.53.png

          With "Allow creation of records in this table via this relationship" enabled this will create a related record in your portal when user starts typing in your portal. You can also via Script go to fields in your Portal and set information by using Go to Portal Row (Last)

          Skärmavbild 2016-10-06 kl. 08.23.37.png

          And then Go to Field to use Set Field in your script with data of your choice

          • 2. Re: Caller ID All Client Refresh
            miler24

            You're right in that client portals may not auto-update and it's difficult to force that.  The easiest approach is to have an on timer running on the client's window with the portal so that it can refresh the portal at regular intervals.  There are other more radical methods as well, like resetting the primary key on the record your clients are sitting on to view the portal.

            • 3. Re: Caller ID All Client Refresh
              GoogleMac

              I am using PHP because the phone company sends us information over this medium. A new record of the caller's info is created every time a call comes in. This all happens on the server.

               

              On the client machines, a few major layouts have a portal strip on the side. This portal shows the last 15 calls or so. When they click on a call record, they are taken to that customer's related record in a different database. Or, if it is a new caller, a new record is created with the information in the caller ID database from that call. Hopefully that explains a bit more.

               

              I will look at the Portal Settings, but I don't know if the scripting will work. I'm not trying to "add" any new records.. The PHP already did that. I'm trying to show that recently created record (current items in the portal should shift down and the new one would be at the top- currently this only happens when the refresh button is pressed).

              • 4. Re: Caller ID All Client Refresh
                Johan Hedman

                If you just want your portal to show last created record then you should have a a field in your database called CreatedTimeStamp that automatically set the field to creation Timestamp when record is created. Then in your portal, you do a Sort on that field in Descending order

                • 5. Re: Caller ID All Client Refresh
                  GoogleMac

                  I do have a serial number field that sorts this portal. My problem isn't getting the information correct and in place, it's getting the last record to pop up at all (without anyone ever clicking on anything).

                  • 6. Re: Caller ID All Client Refresh
                    Johan Hedman

                    You need to use the script step Refresh Window. That will show you all records in the portal correctly. Have a button users can click on all use a OnTimer Script that runs every 30/60 seconds that just does Refresh Window

                    • 7. Re: Caller ID All Client Refresh
                      GoogleMac

                      I need this to be more than every 30 to 60 seconds. The caller ID is what the office staff looks at right when the call comes in. They need to see who is calling. So it would have to update every 3 seconds or so. This type of recurring script could slow down the system. And again, I'm not wanting to have a button that users click. I know that it's possible to run a script when records are committed which is what the PHP is doing. The script is not refreshing the window on any of the client machines.

                      • 8. Re: Caller ID All Client Refresh
                        Johan Hedman

                        Then use OnTimer to run every 3 sec. That is not a problem

                         

                        Skärmavbild 2016-10-06 kl. 16.53.57.png

                        • 9. Re: Caller ID All Client Refresh
                          GoogleMac

                          This works great! I had thought onTimer was a script trigger, not a script item. Now I see how this works. I will keep track of the performance to see if it slows at all, but this works very well!

                          • 10. Re: Caller ID All Client Refresh
                            Johan Hedman

                            Glad I could help