Last Visit & Number of day since last visit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jpajmo
    Junior Member
    • Jan 2025
    • 18

    #1

    Last Visit & Number of day since last visit

    Hi,

    I'm just getting familiar with the Advanced Pack extension, I need help on how I can accomplish this, if somebody can guide me on this I appreciated it

    So, I created a Date field in Accounts that the user can choose the date when they visit this account, easy But I want a field that calculate the number of days automatically since the date of the last visit, it's this possible with Workflow? If yes, can this number of day field can have color, like, more than 30 days is yellow, more than 60 is red...

    Thanks everyone!

    Regards

    JP
  • dreginald
    Senior Member
    • Sep 2018
    • 159

    #2
    You can do it with a scheduled workflow with formula action to trigger every day. To show color, use an Enum Field with options <30, 30 to 60 and so on, with color and write formula to select the options, based on the number of days

    Comment

    • jpajmo
      Junior Member
      • Jan 2025
      • 18

      #3
      Hi,

      Here I added some screenshots of my setting and what I try to accomplish. If somebody can help me I really appreciated it

      This is the field Last Visit that the user put the date of the last Account visit:
      Click image for larger version

Name:	image.png
Views:	0
Size:	3.6 KB
ID:	121548
      I also created another Field (Multi-Enum) named # Days Since Last Visit with all differents choice that he need to automatically applied depending of the dayspassed since last visit:
      Click image for larger version

Name:	image.png
Views:	0
Size:	25.5 KB
ID:	121549

      What kind a formula I need to create to make this work? I tried bunch of formula but nothing work...

      This is the Workflow I tried in case the last visit date is less than 15 days:

      Click image for larger version

Name:	image.png
Views:	0
Size:	39.5 KB
ID:	121550

      Please let me know if you need to have more screenshot

      Thanks everyone!

      JP​

      ​​

      Comment

      • dreginald
        Senior Member
        • Sep 2018
        • 159

        #4
        Formula in Account >Days Since Last Visited (Integer Field) = datetime\diff(datetime\today(), lastVisitDate, 'days);

        Enum Field is to Show the Days Since Last Visited in Color. You need to write a formula

        ifThen(Days Since Last Visit (Integer)<=15, Days Since Last Visi​t (Enum)='Less than 15 Days');
        ​ifThen(Days Since Last Visi​t (Integer)>=15 && Days Since Last Visi​t (Integer)<=30, Days Since Last Visi​t (Enum)='Less than 30Days');

        Scheduled Workflow is for updating this formula daily so that the Days Since Last visited is updated Daily.

        Comment

        • jpajmo
          Junior Member
          • Jan 2025
          • 18

          #5
          Originally posted by dreginald
          Formula in Account >Days Since Last Visited (Integer Field) = datetime\diff(datetime\today(), lastVisitDate, 'days);

          Enum Field is to Show the Days Since Last Visited in Color. You need to write a formula

          ifThen(Days Since Last Visit (Integer)<=15, Days Since Last Visit (Enum)='Less than 15 Days');
          ​ifThen(Days Since Last Visi​t (Integer)>=15 && Days Since Last Visi​t (Integer)<=30, Days Since Last Visi​t (Enum)='Less than 30Days');

          Scheduled Workflow is for updating this formula daily so that the Days Since Last visited is updated Daily.
          Hi dreginald,

          Thank you very much for the information!!

          Ok just to make sure I put these info correctly, I added this formula in Administration - Entity Manager - Account - Formula​

          Click image for larger version

Name:	image.png
Views:	0
Size:	51.1 KB
ID:	121580
          Then I just need to create a Scheduled Workflow like this one right?


          Click image for larger version

Name:	image.png
Views:	0
Size:	44.5 KB
ID:	121582

          Thanks again for all this

          JP​



          Attached Files

          Comment

          • jpajmo
            Junior Member
            • Jan 2025
            • 18

            #6
            Originally posted by jpajmo

            Hi dreginald,

            Thank you very much for the information!!

            Ok just to make sure I put these info correctly, I added this formula in Administration - Entity Manager - Account - Formula

            Click image for larger version  Name:	image.png Views:	0 Size:	51.1 KB ID:	121580
            Then I just need to create a Scheduled Workflow like this one right?


            Click image for larger version  Name:	image.png Views:	0 Size:	44.5 KB ID:	121582

            Thanks again for all this

            JP​



            I tried to run it and it doesn't show the Multi Enum choice based on the date selected:

            Click image for larger version

Name:	image.png
Views:	0
Size:	15.5 KB
ID:	121585
            Did I missed something...

            Thanks !

            JP

            Comment

            • jpajmo
              Junior Member
              • Jan 2025
              • 18

              #7
              Originally posted by dreginald
              Formula in Account >Days Since Last Visited (Integer Field) = datetime\diff(datetime\today(), lastVisitDate, 'days);

              Enum Field is to Show the Days Since Last Visited in Color. You need to write a formula

              ifThen(Days Since Last Visit (Integer)<=15, Days Since Last Visit (Enum)='Less than 15 Days');
              ​ifThen(Days Since Last Visi​t (Integer)>=15 && Days Since Last Visi​t (Integer)<=30, Days Since Last Visi​t (Enum)='Less than 30Days');

              Scheduled Workflow is for updating this formula daily so that the Days Since Last visited is updated Daily.
              Hi,

              I was able to make it work Thanks a lot for guide me thru this! The result is perfect

              Thanks again!

              Regards

              JP

              Comment

              Working...