36
Views
5
Comments
Solved
check date

Hello , 

I have order and i have 5 status 

1-request 2-incoming 3-pending 4-late 5-deliverd

in page pending i want if the order late 3 days the status is change to late 

in table i have attribute  created on and i want check with date time now 

how i can implement ?

2023-04-16 15-25-31
Krishnanand Pathak
Solution

>Create a server action.
>Add an aggregate to filter(as shown below) all the orders which have created date time more than 3 day and
only those orders that are having pending status.

DiffDays (Order.Creation_Date , CurrDateTime()) > 3 and Order.status = Entities.status.pending

>Then loop over the list return from aggregate and update all the order's status to late.
>Then use the server action inside timer and schedule it as per requirement.

2024-03-22 09-17-23
Chandra Vikas Sharma

Hi,

you can use datetime function and pass the number of days according to your requirement.

you can also refer below post for reference. let me know if still have any query.

https://www.outsystems.com/forums/discussion/37848/date-validation-on-if-condition/

Thanks

CV


  

2024-04-11 10-55-06
Miguel Figueiredo

Hello @moheman aldulimy,

I hope you are doing well.


You can apply a filter with the built-in Date and Time fuction DiffDays() to check that difference:

If(DiffDays(CurrDate(), {Entity}.[Attribute]) > 3, ChangeStatus, DoNothing)


Best regards,

Miguel Figueiredo

2023-04-16 15-25-31
Krishnanand Pathak

Hi Moheman

Create a timer and use it to update the status if the order is having created date time more than 3 day then change the status to late.

Regards
Krishnanand Pathak

2023-03-20 08-36-01
moheman aldulimy

can you send logic image 

2023-04-16 15-25-31
Krishnanand Pathak
Solution

>Create a server action.
>Add an aggregate to filter(as shown below) all the orders which have created date time more than 3 day and
only those orders that are having pending status.

DiffDays (Order.Creation_Date , CurrDateTime()) > 3 and Order.status = Entities.status.pending

>Then loop over the list return from aggregate and update all the order's status to late.
>Then use the server action inside timer and schedule it as per requirement.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.