Last call/meeting date as field on contact

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrismc
    Member
    • Jun 2019
    • 47

    Last call/meeting date as field on contact

    Hi, we want to have a new field for the entity "Contact" that always shows the last/youngest date when a call/meeting happened.

    The use case is that I want to sort the contacts when they were last contacted through a meeting or call.
    Do I need a custom function or workflow? What is the best way to set this up?

    Thanks,
    Christoph
  • chrismc
    Member
    • Jun 2019
    • 47

    #2
    Anyone?

    Comment

    • Maximus
      Senior Member
      • Nov 2018
      • 2731

      #3
      Hello.
      You can try to make something like this:
      1. Create in the Contact entity the 3 new fields "lastCall", "lastEmail" and "lastTouch" of a Date type;
      2. Add the lastTouch field into the layout of the Contact entity;
      3. Create the workflows for the Email and Call entities:
      3.1. Email workflow:
      3.1.1. trigger type -> 'after record saved',
      3.1.2. filter all -> 'Status = Sent',
      3.1.3. action -> update related record -> Parent -> Contact -> add field -> lastEmail -> field -> targetEntity -> dateSent.
      3.2. Call workflow:
      3.2.1. trigger type -> 'after record saved',
      3.2.2. filter all -> 'Status = Held',
      3.2.3. action -> update related record -> Contact -> add field -> lastCall -> field -> targetEntity -> dateStart.
      This will work for the future changing. If you want to update all demanded data in the lastEmail and lastCall fields for the existed Call and Email records you need go to the Call and Email entities, select all records and use a mass update of some not important field to run the workflow.

      This will only give you the dates of the last call and last message. But you need to know what the last date you have touched your customer whatever it was the call or email, right? For this, you have to create a formula for the Contact entity for the lastTouch field (which we have created on the beginning) that should define what date between the lastEmail and lastCall is the last.

      I haven't tested this but I suppose this should work.

      Comment

      • Maximus
        Senior Member
        • Nov 2018
        • 2731

        #4
        Ok. Now I have checked it and it works.
        Here is the formula for the Contact entity:
        Code:
        ifThenElse(
            lastCall > lastEmail,
            lastTouch = lastCall,
            lastTouch = lastEmail
        )

        Comment

        • chrismc
          Member
          • Jun 2019
          • 47

          #5
          Thank you very much Maximus! Perfect!

          Comment

          • chrismc
            Member
            • Jun 2019
            • 47

            #6
            I am still struggling with this and appreciate the help of the community!

            What I want to do: custom field of type "date" at entity "contact": "contactActivityLastPhone". This should show the youngest date of an associated "call" object, i.e. I want this field showing the youngest call date that was done with a contact.

            What I have set up: Workflow on target entity "call" and trigger after record update. Action to update linked entity "contact with the formula:
            ifThen(dateStart > targetEntity\attribute('contactActivityLastPhone') , targetEntity\setAttribute('contactActivityLastPhon e', dateStart));

            The problem: Nothing is updated. Configuring the logfile for DEBUG mode shows nothing in the logfile about errors.

            Any ideas? Thanks!
            Chris

            Comment

            • Maximus
              Senior Member
              • Nov 2018
              • 2731

              #7
              Hi Cris,
              Try to rewrite the formula this way:
              Code:
              ifThen(
                  dateStart > contactActivityLastPhone,
                  contactActivityLastPhone = dateStart
              );

              Comment

              • chrismc
                Member
                • Jun 2019
                • 47

                #8
                Thanks Maximus. I tried this before and again but it does not work. I see that the workflow is triggered and running. But the target field is not changed at the contact. What is the best way to debug this? Setting loggin to debug did not help me

                Comment

                • Maximus
                  Senior Member
                  • Nov 2018
                  • 2731

                  #9
                  Could you tell me what a field type is the 'contactActivityLastPhone' field and provide your workflow screenshots with all its configs? I will check it.

                  Comment

                  • chrismc
                    Member
                    • Jun 2019
                    • 47

                    #10
                    Hi Maximus,

                    - contactActivityLastPhone is of type Date. dateStart in the Call object is of type "date and time". maybe this is the problem?
                    - Screenshot attached, sorry its in German
                    Attached Files

                    Comment

                    • Maximus
                      Senior Member
                      • Nov 2018
                      • 2731

                      #11
                      Chris, please take a look at the screenshot. This works well. I have set a few conditions to trigger the workflow (if parentType = 'Contact' and if status = 'Held'. It will helps your system to avoid from creating the needless flows.
                      Attached Files

                      Comment

                      • chrismc
                        Member
                        • Jun 2019
                        • 47

                        #12
                        Amazing, it works! Thanks a lot Maximus!

                        Comment

                        Working...