10 Replies Latest reply on Jan 2, 2013 8:58 PM by JimmyMadison

    Up dating a remarks field

    JimmyMadison

      I have been creating a dispatch solution for our sheriff's office dispatch. I keeps up with case numbers and dispatch times along with other data pertaining to the call dispatched. Each unique case number has a field named "Remarks" which will contain the comments of the called dispatched. I need to be able to use a button to append new comments as they come in from the deputy in the field starting with the time the comment came in. Every time I try this, it placed the original comment and can't seem to get it to append the comment field.

       

      example

       

      10:24:23 W2 requested an ambulance

       

      10:28:44 RPS notified and responding

       

      10:49:22 W2 reported ambulance is on scene

       

      10:55:29 RPS transporting 2 patients to Cullman Hospital

       

      If someone wish to contact me offline my email address is jmadison@winstonsheriff.org

       

      I am using filemaker pro advanced 11 on a pc platform

       

      I am attaching the first of many layouts the sulation containes.

       

      Thaks for your help.

        • 1. Re: Up dating a remarks field
          Kantala

          Hi

           

          As you've noted, you're overwriting any existing comments when you enter the current time.  You could instead use these two steps:

           

          Set Field [Dispatch::Remarks; Get ( CurrentTime ) & " " & If (not IsEmpty (Dispatch::Remarks) ; ¶ & Dispatch::Remarks)]

          Set Selection [Dispatch::Remarks; Start Position: Length (GetValue (Dispatch::Remarks; 1) ) + 1]

           

          These add the current time to the start of the field while preserving anything in there already, then set the cursor to immediately after the time on the first line so you can start typing your remarks.

           

          Hope this helps, there are no doubt other ways to do the same thing, but this should get you started.

           

          Regards

           

           

          Matt

          • 2. Re: Up dating a remarks field
            comment

            user16395 wrote:

             

            I need to be able to use a button to append new comments as they come in from the deputy in the field starting with the time the comment came in.

             

            It would be best to create a new record in a related table for each comment. This will also allow you to use a separate field for the time/timestamp.

            • 3. Re: Up dating a remarks field
              LyndsayHowarth

              Absolutely agree!

               

              Sent from my iPad

              Lyndsay Howarth

              11th Hour Group Pty Ltd

              • 4. Re: Up dating a remarks field
                JimmyMadison

                The only problem I would have with it is the remarks would have to be referenced to the case number created for the call. If I used another table it would be harder to retrieve all the comments for the unique case number.

                 

                Sent from my iPhone

                • 5. Re: Up dating a remarks field
                  BruceRobertson

                  Well no, that is not a problem. The case number would be the foreign key for the note table.

                  • 6. Re: Up dating a remarks field
                    comment

                    If you enter the comments directly into a portal placed on a layout of Cases, the case number will be automatically populated for each new comment you create through the portal. If you prefer to use a dedicated layout, have your "New Comment" button do something like:

                     

                    Set Variable [ $caseID ; Cases::CaseID ]

                    Go to Layout [ Comments ]

                    New Record

                    Set Field [ Comments::CaseID ; $caseID ]

                    Go to Field [ Comments::Text ]

                    • 7. Re: Up dating a remarks field

                      Hi User16395,

                       

                      And if entering new records through the portal, you must check 'Allow Creation' in the relational dialog on the Notes side.  :^)

                      • 8. Re: Up dating a remarks field
                        nickchapin

                        I, too, agree that that you should normalize your data. However, if for whatever reason that's not a viable option you may want to review an older technique on adding a timestamp to your notes field along with the new comments. Search on Matt Petrowski's site for something called Auto Notes. I think it was from a few years back.

                        • 9. Re: Up dating a remarks field
                          Stephen Huston

                          Another gotcha for portal-based entry: you might want to restrict editing and deletion based on time elapsed from creation TimeStamp so that users can view but not edit comments which have been posted for over ##-seconds/minutes so that inadvertent editing of existing posts is avoided.

                           

                          Of give them a 2-portal option. One which shows only the last (blank-creatable) record row, for posting a new comment; another portal below it with no editing access to fields to show existing comments with latest at top. This system is often used to assure that new antries are made at the top, and immediately drop down to the next row with a new blank row at the top ready for the next entry.

                           

                          Portal filtering can also be used to acchieve this, but it's not necessary for this to be workable.

                          • 10. Re: Up dating a remarks field
                            JimmyMadison

                            Thanks for everyones input on this one. Sorry for waiting so long on getting back to reply. Been out of town with no computer for the holidays. Matt I used your script and it  works as I needed it. Thanks again to all that replyed.

                             

                            Thanks

                             

                            Jimmy