8 Replies Latest reply on Oct 5, 2015 1:41 AM by

    Creating a Follow-Up Action

    RogerBirch

      Having created certain contacts in my “contacts” database, there are some that I want to return to after a period of time.

      To enable this, I want to enter a “FollowUp” date in a “date” field against my designated contact so that when the date is reached my record would pop up or a reminder would pop up to tell me to return to that “contact”.

      Creating the “date” field is not a problem but I am trying (with difficulty) to create a script to produce this solution.

      Any assistance would be much appreciated.

        • 1. Re: Creating a Follow-Up Action
          erolst

          Hi Roger –

           

          sorry I didn't respond to your mail, was busy with other stuff.

           

          What is exactly your problem? Setting the reminder/follow-up field to a certain date (e.g. current + offset), or finding records thusly flagged – or both?

          • 2. Re: Creating a Follow-Up Action
            RogerBirch

            Thanks for coming back, both seem to be giving me grief.

            • 3. Re: Creating a Follow-Up Action
              erolst

              To set your follow-up to a calculated date, you could just display a button and attach to it the single script step Set Field[], like

               

              Set Field [ target field: Table::followUpDate ; calculated value: Get ( CurrentDate ) + 7 ]

               

              To find all contacts that have followUpDate of today, use e.g.

               

              Enter Find Mode

              Go to Layout [ Contacts ( Contacts ) ]

              Set Field [ Contacts::followUpDate ; Get ( CurrentDate ) ]

              Perform Find

               

              All contacts that have a reminder date of tomorrow:

              Set Field [ Contacts::followUpDate ; Get ( CurrentDate ) + 1 ]

               

              All within the next 7 days:

              Set Field [ Contacts::followUpDate ; Get ( CurrentDate ) + 1 & ".." & Get ( CurrentDate ) + 7 ]

               

              etc.

               

              As suggested, you may want to add a resolved/done flag, so you can leave the date info intact, but deactivate the attribute as such.

              That could be a simple number field, say “followUpDone”, that you display it as a checkbox with a value list of 1 (just the number)

               

              Then amend your Find scripts with

               

              Enter Find Mode

              Go to Layout [ Contacts ( Contacts ) ]

              Set Field [ Contacts::followUpDate ; Get ( CurrentDate ) ]

              Set Field ( Contacts::followUpDone ; "=" ]

              Perform Find

               

              I suggest you experiment a bit with scripting; it's not rocket science,and having a bit of sample code should get you into the mood …

              • 4. Re: Creating a Follow-Up Action

                Hi again erolst

                Thanks for replying, first hurdle:-

                I am trying to create the button as suggested with SetField etc.

                I am specifying a calculated single script calculated as follows:- Contacts::FollowUpOn;Get(CurrentDate)+7 BUT when I press OK, I get a messsage saying "An operator is needed here" and highlighting ";Get(CurrentDate)+7"

                Can you please advise why this should be?

                Thanks.

                • 5. Re: Creating a Follow-Up Action
                  erolst

                  Guest wrote:

                  Contacts::FollowUpOn;Get(CurrentDate)+7

                   

                  Note that Set Field[] has two options, and two buttons that go with them:

                   

                  Contacts::FollowUpOn


                  is the (target) field you want to set; it must be selected (specified) from a field picker dialog;


                  Get ( CurrentDate ) + 7


                  is the calculation that you “specify” as the result.

                  • 6. Re: Creating a Follow-Up Action
                    RogerBirch

                    Once again, many thanks erolst for feedback. That last bit of information made it much clearer.

                    I have stood back at what I have been trying to achieve and taken a more objective look at my idea in hand.

                    In short, although I know what I want to achieve, I have a problem in understanding the correct script to choose. (AS an aside, can you recommend any websites that would give me a better understanding of the language, which I believe is db?)

                    What I want to achieve is as follows:-

                    I have a database of clients, one of the fields is a date field - (Call it FollowUpDate). In this field I want put a date sometime into the future from when I create it. Another feature would be an “Action” button.

                    I would then like to be able to press the “Action” button which will give me a reminder (or pop-up or something) to return me to this particular client at the date designated in the “FollowUpDate” date field as mentioned above.

                    My simple coding would be:-

                    [When “FollowUPDate”=CurrentDate ; Open “ClientRecord which has the same FollowUpDate”]

                    (Result could be Open or send reminder or something)

                    As mentioned above, my problem is identifying the correct script to use for such coding.

                    I apologies erolst for stringing this out with you but at the moment do not know to whom to turn to.

                    • 7. Re: Creating a Follow-Up Action
                      erolst

                      RogerBirch wrote:

                      Another feature would be an “Action” button.

                      I would then like to be able to press the “Action” button which will give me a reminder (or pop-up or something) to return me to this particular client at the date designated in the “FollowUpDate” date field as mentioned above.

                      My simple coding would be:-

                      [When “FollowUPDate”=CurrentDate ; Open “ClientRecord which has the same FollowUpDate”]

                      (Result could be Open or send reminder or something)

                       

                      Simplest ways: Create a script like this:

                       

                      Enter Find Mode

                      Set Field [ Contact::followUpDate ; Get ( CurrentDate ) ]

                      Set Error Capture

                      Perform Find

                      If [ not Get ( FoundCount ) ]

                        Show Custom Dialog [ "No Actions for today!" ]

                      Else If [ Get ( FoundCount ) > 1 ]

                      Go to Layout [ Contact_List ( Contact ) ]

                      # [ implicit: remain on original layout (e.g. Contact_Detail) if found count = 1 )

                      End If

                       

                      and attach it to a button. As you can see/read, this script uses a hypothetical list layout to display multiple find results. If you don't need that bit of convenience, just use

                       

                      If [ not Get ( FoundCount ) ]

                        Show Custom Dialog [ "No Actions for today!" ]

                      End If

                      • 8. Re: Creating a Follow-Up Action

                        Great erolst, many thanks, we are up and running with your suggestions.

                        Would you have any ideas on websites etc where I might be able to learn more about this coding?

                        Thanks once again for your patience.