Announcement

Collapse
No announcement yet.

How to change status based on expiry date

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to change status based on expiry date

    Hi All

    I need some help.
    I've created a new entity called session, in that entity I have 2 fields, they are status (Enum) and expiry date (Date).

    For default I've set the status to "Active", however I need to change the status automatically into "Expired" when the expired date hits greater than today.

    Is there any way to achieve this using formula since i don't have the advance pack.

    Thank you in advance for your help

  • #2
    This is easy to achieve by formula datetime

    ifThen(
    datetime\date(expiryDate) > datetime\today(),
    entity\setAttribute(status, 'Expired')
    );

    Advance Pack not necessary.

    Comment


    • #3
      hi Shalmaxb,

      Thank you for tthe reply, If im not mistaken this will be done after the save right?
      In order to do it automatically (Without save) what should i do?

      Comment


      • shalmaxb
        shalmaxb commented
        Editing a comment
        unfortunately I cannot help with that, but I think it is not possible.

      • rabii
        rabii commented
        Editing a comment
        you can use a job and schedule the job on specific time, it will be executed in the background without need to save.

    • #4
      At the end of the day, must have it else not possible. Not unless you can create a CRON job to refresh it on a time basis.

      Comment

      Working...
      X